Java Code Examples for com.google.gwt.user.client.ui.VerticalPanel#setSize()

The following examples show how to use com.google.gwt.user.client.ui.VerticalPanel#setSize() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: appinventor-extensions   File: OdeLog.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new output panel for displaying internal messages.
 */
private OdeLog() {
  // Initialize UI
  Button clearButton = new Button(MESSAGES.clearButton());
  clearButton.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      clear();
    }
  });

  text = new HTML();
  text.setWidth("100%");

  VerticalPanel panel = new VerticalPanel();
  panel.add(clearButton);
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 2
/**
 * Creates a new MockListView component. It places a label inside a simplepanel which
 * is then placed into a vertical panel
 *
 * @param editor  editor of source file the component belongs to
 */
public MockListView(SimpleEditor editor) {
  super(editor, TYPE, images.listview());
  listViewWidget = new VerticalPanel();
  //TODO (Jose) extract magic numbers as ComponentConstants.java
  listViewWidget.setSize(ComponentConstants.LISTVIEW_PREFERRED_WIDTH + "px", "100%");
  listViewWidget.setStylePrimaryName("ode-SimpleMockComponent");
  listViewWidget.setStyleName("listViewComponentStyle", true);

  createFilterBox();

  // textColor must be set before the component is initialized, because onPropertyChange
  // might call setSlementsFromString, which tries to set the item textcolor
  textColor  = DEFAULT_TEXT_COLOR;

  initComponent(listViewWidget);
  MockComponentsUtil.setWidgetBackgroundColor(listViewWidget, DEFAULT_BACKGROUND_COLOR);
}
 
Example 3
/**
 * Creates a {@code ProjectEditor} instance.
 *
 * @param projectRootNode  the project root node
 */
public ProjectEditor(ProjectRootNode projectRootNode) {
  this.projectRootNode = projectRootNode;
  projectId = projectRootNode.getProjectId();
  project = Ode.getInstance().getProjectManager().getProject(projectId);

  openFileEditors = Maps.newHashMap();
  fileIds = new ArrayList<String>();

  deckPanel = new DeckPanel();

  VerticalPanel panel = new VerticalPanel();
  panel.add(deckPanel);
  deckPanel.setSize("100%", "100%");
  panel.setSize("100%", "100%");
  initWidget(panel);
  // Note: I'm not sure that the setSize call below does anything useful.
  setSize("100%", "100%");
}
 
Example 4
Source Project: appinventor-extensions   File: MotdUi.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new output panel for MOTD.
 */
private MotdUi() {
  // Initialize UI
  text = new HTML();
  text.setSize("100%", "100%");
  text.setStylePrimaryName("ode-Motd");

  panel = new VerticalPanel();
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 5
/**
 * Creates a new output panel for messages.
 */
private MessagesOutput() {
  // Initialize UI
  text = new HTML();
  text.setSize("100%", "100%");
  text.setStylePrimaryName("ode-MessagesOutput");

  panel = new VerticalPanel();
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 6
/**
 * FilePath
 */
public FilePath() {
	panel = new VerticalPanel();
	path = new HTML(Main.i18n("filebrowser.path") + ": ", false);
	panel.setStyleName("okm-FilePath-Title");
	panel.setSize("100%", "22px");
	panel.add(path);
	panel.setCellVerticalAlignment(path, VerticalPanel.ALIGN_MIDDLE);
	initWidget(panel);

	// Only executes first time when object is created to initalize values
	getRootPath();
}
 
Example 7
/**
 * Tab multiple
 */
public TabMultiple() {
	panel = new VerticalPanel();
	tabFolder = new TabFolder();
	tabDocument = new TabDocument();
	tabMail = new TabMail();
	status = new Status();
	status.setStyleName("okm-StatusPopup");

	panel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
	panel.setSize("100%", "100%");

	initWidget(panel);
}
 
Example 8
public Navigator() {
	stackPanel = new ExtendedStackPanel();
	scrollTaxonomyPanel = new ExtendedScrollPanel();
	scrollTaxonomyPanel.setSize("100%", "100%");
	scrollCategoriesPanel = new ScrollPanel();
	scrollCategoriesPanel.setSize("100%", "100%");
	scrollMetadataPanel = new ScrollPanel();
	scrollMetadataPanel.setSize("100%", "100%");
	scrollThesaurusPanel = new ScrollPanel();
	scrollThesaurusPanel.setSize("100%", "100%");
	scrollTrashPanel = new ScrollPanel();
	scrollTrashPanel.setSize("100%", "100%");
	scrollTemplatePanel = new ExtendedScrollPanel();
	scrollTemplatePanel.setSize("100%", "100%");
	scrollPersonalPanel = new ExtendedScrollPanel();
	scrollPersonalPanel.setSize("100%", "100%");
	scrollMailPanel = new ExtendedScrollPanel();
	scrollMailPanel.setSize("100%", "100%");
	verticalTaxonomyPanel = new VerticalPanel();
	verticalTaxonomyPanel.setSize("100%", "100%");
	verticalCategoriesPanel = new VerticalPanel();
	verticalCategoriesPanel.setSize("100%", "100%");
	verticalMetadataPanel = new VerticalPanel();
	verticalMetadataPanel.setSize("100%", "100%");
	verticalThesaurusPanel = new VerticalPanel();
	verticalThesaurusPanel.setSize("100%", "100%");
	verticalTrashPanel = new VerticalPanel();
	verticalTrashPanel.setSize("100%", "100%");
	verticalTemplatePanel = new VerticalPanel();
	verticalTemplatePanel.setSize("100%", "100%");
	verticalMyDocumentsPanel = new VerticalPanel();
	verticalMyDocumentsPanel.setSize("100%", "100%");
	verticalMailPanel = new VerticalPanel();
	verticalMailPanel.setSize("100%", "100%");

	status = new Status();
	status.setStyleName("okm-StatusPopup");
	trashTree = new TrashTree();
	trashTree.setSize("100%", "100%");
	templateTree = new TemplateTree();
	templateTree.setSize("100%", "100%");
	mailTree = new MailTree();
	mailTree.setSize("100%", "100%");
	personalTree = new PersonalTree();
	personalTree.setSize("100%", "100%");
	thesaurusTree = new ThesaurusTree();
	thesaurusTree.setSize("100%", "100%");
	metadataTree = new MetadataTree();
	metadataTree.setSize("100%", "100%");
	categoriesTree = new CategoriesTree();
	categoriesTree.setSize("100%", "100%");
	taxonomyTree = new TaxonomyTree();
	taxonomyTree.setSize("100%", "100%");

	verticalTaxonomyPanel.add(taxonomyTree);
	scrollTaxonomyPanel.add(verticalTaxonomyPanel);
	verticalCategoriesPanel.add(categoriesTree);
	scrollCategoriesPanel.add(verticalCategoriesPanel);
	verticalMetadataPanel.add(metadataTree);
	scrollMetadataPanel.add(verticalMetadataPanel);
	verticalThesaurusPanel.add(thesaurusTree);
	scrollThesaurusPanel.add(verticalThesaurusPanel);
	verticalTrashPanel.add(trashTree);
	scrollTrashPanel.add(verticalTrashPanel);
	scrollTrashPanel.addStyleName("okm-DisableSelect"); // Disables drag and drop browser text selection
	verticalTemplatePanel.add(templateTree);
	scrollTemplatePanel.add(verticalTemplatePanel);
	verticalMyDocumentsPanel.add(personalTree);
	scrollPersonalPanel.add(verticalMyDocumentsPanel);
	verticalMailPanel.add(mailTree);
	scrollMailPanel.add(verticalMailPanel);

	scrollTaxonomyPanel.setStyleName("okm-Background-White");
	scrollCategoriesPanel.setStyleName("okm-Background-White");
	scrollMetadataPanel.setStyleName("okm-Background-White");
	scrollThesaurusPanel.setStyleName("okm-Background-White");
	scrollTrashPanel.setStyleName("okm-Background-White");
	scrollTemplatePanel.setStyleName("okm-Background-White");
	scrollPersonalPanel.setStyleName("okm-Background-White");
	scrollMailPanel.setStyleName("okm-Background-White");

	stackPanel.setStyleName("okm-StackPanel");

	initWidget(stackPanel);
}
 
Example 9
/**
 * The Document tab
 */
public TabDocument() {
	doc = new GWTDocument();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	document = new Document();
	notes = new Notes(Notes.DOCUMENT_NOTE);
	version = new VersionScrollTable();
	security = new SecurityScrollTable();
	preview = new Preview(null);
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();
	widgetExtensionList = new ArrayList<TabDocumentExtension>();
	docHandlerExtensionList = new ArrayList<DocumentHandlerExtension>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			final int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			preview.cleanPreview(); // Always clean preview tab

			if (tabIndex == PREVIEW_TAB) {
				Timer previewTimer = new Timer() {
					@Override
					public void run() {
						previewDocument(false);
					}
				};
				previewTimer.schedule(500);
			}

			fireEvent(HasDocumentEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	document.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}
 
Example 10
/**
 * The Document tab
 */
public TabMail() {
	widgetExtensionList = new ArrayList<TabMailExtension>();
	mailHandlerExtensionList = new ArrayList<MailHandlerExtension>();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	mail = new Mail();
	notes = new Notes(Notes.MAIL_NOTE);
	mailViewer = new MailViewer();
	security = new SecurityScrollTable();
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			fireEvent(HasMailEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	mail.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	mailViewer.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}
 
Example 11
/**
 * TabFolder
 */
public TabFolder() {
	widgetExtensionList = new ArrayList<TabFolderExtension>();
	folderHandlerExtensionList = new ArrayList<FolderHandlerExtension>();
	propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
	tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
	folder = new Folder();
	security = new SecurityScrollTable();
	notes = new Notes(Notes.FOLDER_NOTE);
	panel = new VerticalPanel();
	propertyGroup = new ArrayList<PropertyGroup>();

	tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
		@Override
		public void onSelection(SelectionEvent<Integer> event) {
			int tabIndex = event.getSelectedItem().intValue();
			Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
			selectedTab = tabIndex;

			if (tabIndex == SECURITY_TAB) {
				Timer timer = new Timer() {
					@Override
					public void run() {
						security.fillWidth(); // Always when shows fires fill width
					}
				};
				timer.schedule(500); // Fill width must be done after really it'll be visible
			}

			fireEvent(HasFolderEvent.TAB_CHANGED);
		}
	});

	panel.add(tabPanel);
	tabPanel.setWidth("100%");
	folder.setSize("100%", "100%");
	notes.setSize("100%", "100%");
	panel.setSize("100%", "100%");
	tabPanel.setStyleName("okm-DisableSelect");

	initWidget(panel);
}