Java Code Examples for com.google.gwt.user.client.ui.HorizontalPanel.setWidth()

The following are Jave code examples for showing how to use setWidth() of the com.google.gwt.user.client.ui.HorizontalPanel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: sig-seguimiento-vehiculos   File: BasicToolBar.java   Source Code and License Vote up 6 votes
private void initializew3wPanel() {
	w3wPanel = new HorizontalPanel();
	w3wPanel.setSpacing(5);
	w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	w3wPanel.setStyleName("w3wPanel");
	w3wPanel.setWidth("415px");

	wordsLabel = new Label();
	w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
			.setText(UIMessages.INSTANCE.what3Words())
			.setTitle("https://what3words.com/").build();
	w3wAnchor.getElement().getStyle().setColor("#FF0000");
	w3wAnchor.setVisible(false);
	w3wPanel.add(w3wAnchor);
	w3wPanel.add(wordsLabel);
}
 
Example 2
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   Source Code and License Vote up 6 votes
private void createSeparatorPanel() {
	separatorPanel = new HorizontalPanel();
	separatorPanel.setSpacing(1);
	separatorPanel.setWidth("100%");
	separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
	separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	separatorPanel
			.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	separatorPanel.add(new Label(UIMessages.INSTANCE
			.separator(DEFAULT_CSV_SEPARATOR)));
	separatorTextField = new TextField();
	separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
	separatorTextField.setWidth(30);

	separatorPanel.add(separatorTextField);
}
 
Example 3
Project: appinventor-extensions   File: Toolbar.java   Source Code and License Vote up 6 votes
/**
 * Initializes and assembles all commands into buttons in the toolbar.
 */
public Toolbar() {
  buttonMap = new HashMap<String, TextButton>();
  dropDownButtonMap = new HashMap<String, DropDownButton>();

  leftButtons = new HorizontalPanel();
  leftButtons.setSpacing(4);

  rightButtons = new HorizontalPanel();
  rightButtons.setSpacing(4);
  rightButtons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);

  HorizontalPanel toolbar = new HorizontalPanel();
  toolbar.add(leftButtons);  // this nesting keeps buttons left aligned
  toolbar.add(rightButtons);
  toolbar.setCellHorizontalAlignment(rightButtons, HorizontalPanel.ALIGN_RIGHT);
  toolbar.setWidth("100%");
  toolbar.setStylePrimaryName("ya-Toolbar");

  initWidget(toolbar);
}
 
Example 4
Project: appinventor-extensions   File: GalleryAppBox.java   Source Code and License Vote up 6 votes
/**
 * Creates new Gallery app box.
 */
private GalleryAppBox() {
  gContainer = new FlowPanel();
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(Ode.getImageBundle().waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(Ode.getMessages().defaultRpcMessage());
  panel.add(label);
  gContainer.add(panel);
  this.add(gContainer);
}
 
Example 5
Project: appinventor-extensions   File: StatusPanel.java   Source Code and License Vote up 6 votes
/**
   * Initializes and assembles all UI elements shown in the status panel.
   */
  public StatusPanel() {
    HorizontalPanel hpanel = new HorizontalPanel();
    hpanel.setWidth("100%");
    hpanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    String tosUrl = Ode.getInstance().getSystemConfig().getTosUrl();
    if (!Strings.isNullOrEmpty(tosUrl)) {
      String appInventorFooter =
          "<a href=\"" + tosUrl + "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
      hpanel.add(new HTML(appInventorFooter));
    }

    // This shows the git version and the date of the build
//    String version = GitBuildId.getVersion();
//    String date = GitBuildId.getDate();
//    if (version != null && date != null) {
//      Label buildId = new Label(MESSAGES.gitBuildId(date, version));
//      hpanel.add(buildId);
//      hpanel.setCellHorizontalAlignment(buildId, HorizontalPanel.ALIGN_RIGHT);
//    }

    initWidget(hpanel);
    setStyleName("ode-StatusPanel");
  }
 
Example 6
Project: firefly   File: GwtUtil.java   Source Code and License Vote up 6 votes
public static HorizontalPanel makeHoriPanel(HasHorizontalAlignment.HorizontalAlignmentConstant halign,
                                            HasVerticalAlignment.VerticalAlignmentConstant valign,
                                            Widget... widgets) {
    HorizontalPanel hp = new HorizontalPanel();
    for (Widget w : widgets) {
        hp.add(w);
    }
    if (halign != null) {
        hp.setHorizontalAlignment(halign);
        hp.setWidth("100%");
    }
    if (valign != null) {
        hp.setVerticalAlignment(valign);
    }
    return hp;
}
 
Example 7
Project: appformer   File: NewFilterPopup.java   Source Code and License Vote up 6 votes
private void addCreateFilterButton(final Command addfilterCommand) {
    HorizontalPanel buttonPanel = new HorizontalPanel();
    buttonPanel.setWidth("100%");
    buttonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    Button createFilterButton = new Button();
    createFilterButton.setText(CommonConstants.INSTANCE.Add_New_Filter());

    createFilterButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            getFormValues(filterControlGroups);
            if (validateForm()) {
                addfilterCommand.execute();
                refreshGrid();
                cleanFormValues(filterControlGroups);
                tabAdd.showTab();
            }
        }
    });
    buttonPanel.add(createFilterButton);
    horizontalForm.add(buttonPanel);
}
 
Example 8
Project: geowe-core   File: JoinDataDialog.java   Source Code and License Vote up 6 votes
private void createSeparatorPanel() {
	separatorPanel = new HorizontalPanel();
	separatorPanel.setSpacing(1);
	separatorPanel.setWidth("100%");
	separatorPanel.addStyleName(ThemeStyles.get().style().borderTop());
	separatorPanel.addStyleName(ThemeStyles.get().style().borderBottom());
	separatorPanel
			.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	separatorPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	separatorPanel.add(new Label(UIMessages.INSTANCE
			.separator(DEFAULT_CSV_SEPARATOR)));
	separatorTextField = new TextField();
	separatorTextField.setText(DEFAULT_CSV_SEPARATOR);
	separatorTextField.setWidth(30);

	separatorPanel.add(separatorTextField);
}
 
Example 9
Project: geowe-core   File: BasicToolBar.java   Source Code and License Vote up 6 votes
private void initializew3wPanel() {
	w3wPanel = new HorizontalPanel();
	w3wPanel.setSpacing(5);
	w3wPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	StyleInjector.inject(".w3wPanel { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	w3wPanel.setStyleName("w3wPanel");
	w3wPanel.setWidth("415px");

	wordsLabel = new Label();
	w3wAnchor = new AnchorBuilder().setHref("https://what3words.com/")
			.setText(UIMessages.INSTANCE.what3Words())
			.setTitle("https://what3words.com/").build();
	w3wAnchor.getElement().getStyle().setColor("#FF0000");
	w3wAnchor.setVisible(false);
	w3wPanel.add(w3wAnchor);
	w3wPanel.add(wordsLabel);
}
 
Example 10
Project: optaplanner-wb   File: MultiConstraintHardMediumSoftMatchRuleModellerWidget.java   Source Code and License Vote up 6 votes
private HorizontalPanel getItemPanel(final String labelText,
                                     final IsWidget constraintMatchWidget) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();
    horizontalPanel.setWidth("100%");

    HorizontalPanel labelPanel = new HorizontalPanel();
    Label label = new Label(labelText);
    labelPanel.add(label);
    horizontalPanel.add(labelPanel);

    horizontalPanel.add(constraintMatchWidget);

    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");

    return horizontalPanel;
}
 
Example 11
Project: onecmdb   File: ListAttributeScreen.java   Source Code and License Vote up 6 votes
public void load() {
	if (this.currentTemplate == null) {
		setErrorText("No Template to show!");
		return;
	}
	setErrorText("");
	setTitleText("Attributes for ");
	setTitleWidget(new CIIconDisplayNameWidget(this.currentTemplate));
	vPanel.clear();
	
	HTML add = new HTML("[<a href='javascript:;'>new</a>]");
	add.setTitle("Add a new attribute to this template");
	add.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.ADD_ATTRIBUTE_SCREEN, currentTemplate.getAlias(), new Long(0));
		}
		
	});
	HorizontalPanel hPanel = new HorizontalPanel();
	hPanel.add(add);
	hPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT);
	hPanel.setWidth("100%");
	vPanel.add(hPanel);
	vPanel.add(getAttributeTable());
	
}
 
Example 12
Project: firefly   File: Form.java   Source Code and License Vote up 6 votes
public ButtonBar() {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setWidth("100%");
    hp.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
    left = new HorizontalPanel();
    left.setSpacing(3);
    left.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    left.setWidth("100%");

    right = new HorizontalPanel();
    right.setSpacing(3);
    right.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    right.setWidth("100%");
    Label spacerRight = new Label();
    right.add(spacerRight);
    right.setCellWidth(spacerRight, "100%");

    hic.setPixelSize(16,16);
    hp.add(left);
    hp.add(right);
    hp.setCellWidth(right, "100%");
    hp.add(GwtUtil.getFiller(10,1));
    hp.add(hic);

    initWidget(hp);
}
 
Example 13
Project: appformer   File: ColumnListEditorView.java   Source Code and License Vote up 6 votes
@Override
public ColumnListEditor.View insert(final int index,
                                    final DataColumnDefEditor.View columnEditorView,
                                    final boolean selected, final boolean enabled,
                                    final String altText) {
    final CheckBox selectedInput = new CheckBox();
    selectedInput.getElement().getStyle().setCursor(Style.Cursor.POINTER);
    selectedInput.getElement().getStyle().setTop(-7, Style.Unit.PX);
    selectedInput.setEnabled(enabled);
    selectedInput.setValue(selected);
    selectedInput.setTitle(altText != null ? altText : "");
    selectedInput.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
        @Override
        public void onValueChange(final ValueChangeEvent<Boolean> event) {
            presenter.onColumnSelect(index, event.getValue());
        }
    });

    final HorizontalPanel panel = new HorizontalPanel();
    panel.setWidth("100%");
    panel.add(selectedInput);
    panel.add(columnEditorView.asWidget());
    container.insert(panel, index);
    return this;
}
 
Example 14
Project: riscoss-corporate   File: EntitiesListBox.java   Source Code and License Vote up 6 votes
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
	for (int i = 0; i < children.size(); ++i) {
		nextEntityName = children.get(i).isString().stringValue();
		Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
		a.setWidth("100%");
		a.setStyleName("font");
		a.addClickHandler(new ClickHandler() {
			String name = nextEntityName;
			@Override
			public void onClick(ClickEvent event) {
				module.setSelectedEntity(name);
			}
		});
		HorizontalPanel cPanel = new HorizontalPanel();
		cPanel.setStyleName("tree");
		cPanel.setWidth("100%");
		cPanel.add(a);
		TreeWidget c = new TreeWidget(cPanel);
		rootEnt.addChild(c);
		if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
	}
}
 
Example 15
Project: riscoss-corporate   File: RiskAnalysisResults.java   Source Code and License Vote up 6 votes
private void generateTree(TreeWidget c, JSONValue entity) {
	nextEntityName = entity.isObject().get("entity").isString().stringValue();
	Anchor a = new Anchor(nextEntityName);
	a.setWidth("100%");
	a.setStyleName("font");
	a.addClickHandler(new ClickHandler() {
		String name = nextEntityName;
		@Override
		public void onClick(ClickEvent event) {
			setSelectedEntity(name);
		}
	});
	HorizontalPanel cPanel = new HorizontalPanel();
	cPanel.setStyleName("tree");
	cPanel.setWidth("100%");
	cPanel.add(a);
	TreeWidget cc = new TreeWidget(cPanel);
	c.addChild(cc);
	results.put(nextEntityName, entity.isObject().get("results").isArray());
	entities.add(nextEntityName);
	for (int i = 0; i < entity.isObject().get("children").isArray().size(); ++i) {
		generateTree(cc, entity.isObject().get("children").isArray().get(i));
	}
}
 
Example 16
Project: riscoss-corporate   File: RiskAnalysisWizard.java   Source Code and License Vote up 6 votes
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
	for (int i = 0; i < children.size(); ++i) {
		nextEntityName = children.get(i).isString().stringValue();
		Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
		a.setWidth("100%");
		a.setStyleName("font");
		a.addClickHandler(new ClickHandler() {
			String name = nextEntityName;
			@Override
			public void onClick(ClickEvent event) {
				setSelectedEntity(name);
			}
		});
		HorizontalPanel cPanel = new HorizontalPanel();
		cPanel.setStyleName("tree");
		cPanel.setWidth("100%");
		cPanel.add(a);
		TreeWidget c = new TreeWidget(cPanel);
		rootEnt.addChild(c);
		if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
	}
}
 
Example 17
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   Source Code and License Vote up 5 votes
private void getCSVComboPanel() {
	comboPanel = new HorizontalPanel();
	comboPanel.setWidth("100%");
	comboPanel.addStyleName(ThemeStyles.get().style().borderTop());
	comboPanel.setSpacing(5);
	comboPanel.setVisible(false);
	comboPanel.add(new Label(UIMessages.INSTANCE.bindableAttribute()));
	comboPanel.add(csvAttributeCombo);
}
 
Example 18
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   Source Code and License Vote up 5 votes
private void createLayerAttributeComboPanel() {
	layerAttributeComboPanel = new HorizontalPanel();
	layerAttributeComboPanel.setWidth("100%");
	layerAttributeComboPanel.addStyleName(ThemeStyles.get().style()
			.borderBottom());
	layerAttributeComboPanel.setSpacing(5);
	layerAttributeComboPanel.setVisible(false);
	layerAttributeComboPanel.add(new Label(UIMessages.INSTANCE
			.layerSchemaToolText()));
	layerAttributeComboPanel.add(layerAttributeCombo);

}
 
Example 19
Project: appinventor-extensions   File: Ode.java   Source Code and License Vote up 5 votes
private void initializeGallery() {
  VerticalPanel gVertPanel = (VerticalPanel)deckPanel.getWidget(galleryTabIndex);
  gVertPanel.setWidth("100%");
  gVertPanel.setSpacing(0);
  galleryListToolbar = new GalleryToolbar();
  gVertPanel.add(galleryListToolbar);
  HorizontalPanel appListPanel = new HorizontalPanel();
  appListPanel.setWidth("100%");
  appListPanel.add(GalleryListBox.getGalleryListBox());
  gVertPanel.add(appListPanel);

  VerticalPanel aVertPanel = (VerticalPanel)deckPanel.getWidget(galleryAppTabIndex);
  aVertPanel.setWidth("100%");
  aVertPanel.setSpacing(0);
  galleryPageToolbar = new GalleryToolbar();
  aVertPanel.add(galleryPageToolbar);
  HorizontalPanel appPanel = new HorizontalPanel();
  appPanel.setWidth("100%");
  appPanel.add(GalleryAppBox.getGalleryAppBox());
  aVertPanel.add(appPanel);

  VerticalPanel mPVertPanel = (VerticalPanel)deckPanel.getWidget(moderationPageTabIndex);
  mPVertPanel.setWidth("100%");
  mPVertPanel.setSpacing(0);
  HorizontalPanel moderationPagePanel = new HorizontalPanel();
  moderationPagePanel.setWidth("100%");
  moderationPagePanel.add(ModerationPageBox.getModerationPageBox());
  mPVertPanel.add(moderationPagePanel);

  GalleryListBox.loadGalleryList();
  if (user.isModerator()) {
    ModerationPageBox.loadModerationPage();
  }
  PrivateUserProfileTabPanel.getPrivateUserProfileTabPanel().loadProfileImage();

  galleryInitialized = true;
}
 
Example 20
Project: WebConsole   File: AbsolutePanelComponent.java   Source Code and License Vote up 5 votes
public AbsolutePanelComponent() {
	componentContainer = new HorizontalPanel();
	componentContainer.setWidth("100%");
	componentContainer.setHeight("100%");
	componentContainer.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
	componentContainer.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
	
	setPanelWidget(componentContainer);
}
 
Example 21
Project: geowe-core   File: JoinDataDialog.java   Source Code and License Vote up 5 votes
private void createLayerAttributeComboPanel() {
	layerAttributeComboPanel = new HorizontalPanel();
	layerAttributeComboPanel.setWidth("100%");
	layerAttributeComboPanel.addStyleName(ThemeStyles.get().style()
			.borderBottom());
	layerAttributeComboPanel.setSpacing(5);
	layerAttributeComboPanel.setVisible(false);
	layerAttributeComboPanel.add(new Label(UIMessages.INSTANCE
			.layerSchemaToolText()));
	layerAttributeComboPanel.add(layerAttributeCombo);

}
 
Example 22
Project: firefly   File: GwtUtil.java   Source Code and License Vote up 5 votes
public static Widget centerAlign(Widget w) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setWidth("100%");
    hp.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    hp.add(w);
    return hp;
}
 
Example 23
Project: optaplanner-wb   File: BendableConstraintMatchRuleModellerWidget.java   Source Code and License Vote up 5 votes
private HorizontalPanel createConstraintMatchPanel() {
    final HorizontalPanel constraintMatchPanel = new HorizontalPanel();

    constraintMatchPanel.setWidth("100%");
    constraintMatchPanel.add(constraintMatchInputWidget);

    return constraintMatchPanel;
}
 
Example 24
Project: onecmdb   File: DragablePopup.java   Source Code and License Vote up 5 votes
public void load() {
	VerticalPanel panel = new VerticalPanel();
	HorizontalPanel header = new HorizontalPanel();
	header.setStyleName("one-select-popup-header");
	header.setWidth("100%");
	Label headerLabel = new Label(title);
	Image close = new Image("images/eclipse/close.gif");
	header.add(headerLabel);
	header.add(close);
	
	header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT);
	header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT);
	header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE);
	
	// Add drag control.
	new DragControl(this, headerLabel);
	
	close.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			hide();	
		}
	});
	panel.add(header);
	panel.add(content);
	
	panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP);
	panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP);
	panel.setCellHeight(content, "100%");
	setWidget(panel);
}
 
Example 25
Project: appinventor-extensions   File: SimplePaletteItem.java   Source Code and License Vote up 4 votes
/**
 * Creates a new palette item.
 *
 * @param scd component descriptor for palette item
 * @param dropTargetProvider provider of targets that palette items can be dropped on
 */
public SimplePaletteItem(SimpleComponentDescriptor scd, DropTargetProvider dropTargetProvider) {
  this.dropTargetProvider = dropTargetProvider;
  this.scd = scd;

  componentPrototype = null;

  // Initialize palette item UI
  HorizontalPanel panel = new HorizontalPanel();
  panel.setStylePrimaryName("ode-SimplePaletteItem");

  Image image = scd.getImage();
  image.setStylePrimaryName("ode-SimplePaletteItem-icon");
  panel.add(image);
  panel.setCellHorizontalAlignment(image, HorizontalPanel.ALIGN_LEFT);
  panel.setCellWidth(image, "30px");

  Label label = new Label(ComponentsTranslation.getComponentName(scd.getName()));
  label.setHorizontalAlignment(Label.ALIGN_LEFT);
  label.addStyleName("ode-SimplePaletteItem-caption");
  panel.add(label);

  HorizontalPanel optPanel = new HorizontalPanel();

  ComponentHelpWidget helpImage = new ComponentHelpWidget(scd);
  helpImage.addStyleName("ode-SimplePalleteItem-button");
  optPanel.add(helpImage);
  optPanel.setCellHorizontalAlignment(helpImage, HorizontalPanel.ALIGN_LEFT);

  if (scd.getExternal()) {
    ComponentRemoveWidget deleteImage = new ComponentRemoveWidget(scd);
    deleteImage.addStyleName("ode-SimplePalleteItem-button");
    optPanel.add(deleteImage);
    optPanel.setCellHorizontalAlignment(deleteImage, HorizontalPanel.ALIGN_RIGHT);
  }

  panel.add(optPanel);
  panel.setCellHorizontalAlignment(optPanel, HorizontalPanel.ALIGN_RIGHT);

  panel.setWidth("100%");
  add(panel);
  setWidth("100%");

  addHandlers();
}
 
Example 26
Project: appinventor-extensions   File: Ode.java   Source Code and License Vote up 4 votes
private Widget createLoadingWidget(final int pending) {
  final HorizontalPanel container = new HorizontalPanel();
  container.setWidth("100%");
  container.setSpacing(0);
  container.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  HorizontalPanel panel = new HorizontalPanel();
  Image image = new Image();
  image.setResource(IMAGES.waitingIcon());
  panel.add(image);
  Label label = new Label();
  label.setText(MESSAGES.defaultRpcMessage());
  panel.add(label);
  container.add(panel);
  GalleryClient.getInstance().addListener(new GalleryRequestListener() {
    volatile int count = pending;
    private void hideLoadingWidget() {
      if (container.getParent() != null) {
        container.clear();
        container.removeFromParent();
      }
    }
    @Override
    public boolean onAppListRequestCompleted(GalleryAppListResult appsResult, int requestID, boolean refreshable) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onCommentsRequestCompleted(List<GalleryComment> comments) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
    @Override
    public boolean onSourceLoadCompleted(UserProject projectInfo) {
      if ((--count) <= 0) {
        hideLoadingWidget();
        return true;
      }
      return false;
    }
  });
  return container;
}
 
Example 27
Project: x-cure-chat   File: Top10BodyWidget.java   Source Code and License Vote up 4 votes
/**
 * The basic constructor provided with the site section url prefix
 * @param siteSectionPrefix the history token site section prefix
 */
public Top10BodyWidget(  final String siteSectionPrefix ) {
	super();
	
	//Store the data
	this.siteSectionPrefix = siteSectionPrefix;
	
	//Register as the avatar spoiler change listener 
	UserAvatarImageWidget.addAvatarSpoilerChangeListener( this );
	
	//Initialize the main decorated panel
	decoratedPanel = new DecoratorPanel();
	decoratedPanel.setStyleName( CommonResourcesContainer.GRAY_ROUNDED_CORNER_PANEL_STYLE );
	
	//Initialize the vertical
	widgetPanel = new VerticalPanel();
	widgetPanel.setWidth("100%");
	widgetPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	widgetPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	decoratedPanel.add( widgetPanel );
	
	//Initialize the scroll panel
	scrollPanel = new SimplePanel();
	scrollPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
	widgetPanel.add( scrollPanel );
	
	//Initialize the panel storing the statistics widgets
	statWidgetsPanel = new HorizontalPanel();
	statWidgetsPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	statWidgetsPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	statWidgetsPanel.setWidth("100%");
	scrollPanel.add( statWidgetsPanel );
	
	//Add top10 widgets here
	addTop10Widget( new MoneyTop10StatWidget() );
	addTop10Widget( new TimeOnSiteTop10StatWidget() );
	addTop10Widget( new ChatMsgsTop10StatWidget() );
	addTop10Widget( new ForumPostsTop10StatWidget() );
	addTop10Widget( new RegistrationsTop10StatWidget() );
	addTop10Widget( new LastProfileFileTop10StatWidget() );
	addTop10Widget( new VisitsTop10StatWidget() );
	
	//Initialize the composite
	initWidget( decoratedPanel );
}
 
Example 28
Project: scheduling-portal   File: SchedulerPage.java   Source Code and License Vote up 4 votes
/**
 * Creates the layout and adds it to the page
 *
 * <pre>
 * +- content:VLayout --------+
 * |+- tools:Widget ---------+|
 * || # buildTools()         ||
 * |+------------------------+|
 * |+- stack:SectionStack ---+|
 * ||+- jobSection ---------+||
 * |||+- topPane:Layout ---+|||
 * |||| # buildTopPane()   ||||
 * |||+--------------------+|||
 * ||+----------------------+||
 * ||+- detailsSection -----+||
 * |||+- botPane:Layout ---+|||
 * |||| # buildBotPane()   ||||
 * |||+--------------------+|||
 * ||+----------------------+||
 * |+------------------------+|
 * +--------------------------+
 * </pre>
 *
 */
private void buildAndShow() {
    VLayout contentLayout = new VLayout();
    this.rootLayout = contentLayout;
    contentLayout.setWidth100();
    contentLayout.setHeight100();
    contentLayout.setBackgroundColor("#fafafa");

    this.aboutWindow = new AboutWindow();
    this.settingsWindow = new SettingsWindow(controller);

    Canvas tools = buildTools();

    HorizontalPanel panel = new HorizontalPanel();
    panel.setWidth("100%");
    panel.setHeight("3px");
    panel.getElement().getStyle().setBackgroundColor("#f47930");
    panel.getElement().getStyle().setPadding(-1, Unit.PX);

    SectionStackSection executionsSections = this.controller.buildExecutionsView();

    Layout botPane = buildBotPane();
    SectionStackSection detailsSection = new SectionStackSection();
    detailsSection.setTitle("Details");
    detailsSection.setExpanded(true);
    detailsSection.setItems(botPane);

    SectionStack stack = new SectionStack();
    stack.setWidth100();
    stack.setHeight100();
    stack.setMargin(2);
    stack.setVisibilityMode(VisibilityMode.MULTIPLE);
    stack.setAnimateSections(true);
    stack.setOverflow(Overflow.HIDDEN);

    stack.setSections(executionsSections, detailsSection);

    contentLayout.addMember(buildLogoStrip());
    contentLayout.addMember(tools);
    contentLayout.addMember(panel);
    contentLayout.addMember(stack);
    this.logWindow = new LogWindow(controller);

    this.rootLayout.draw();
}
 
Example 29
Project: che   File: CellTableRuntimeInfoWidgetFactory.java   Source Code and License Vote up 4 votes
@Override
public Widget create(String machineName, List<RuntimeInfo> runtimeList) {
  VerticalPanel panel = new VerticalPanel();
  panel.ensureDebugId("runtimeInfoVerticalPanel");
  panel.setWidth("100%");

  Label caption = new Label(locale.cellTableCaption(machineName));
  caption.ensureDebugId("runtimeInfoCellTableCaption");
  caption.addStyleName(resources.cellTableStyle().cellTableCaption());

  HorizontalPanel hPanel = new HorizontalPanel();
  hPanel.setWidth("100%");
  hPanel.ensureDebugId("runtimeInfoCellTableHeaderWrapper");
  hPanel.add(caption);

  ListDataProvider<RuntimeInfo> dataProvider = new ListDataProvider<>(runtimeList);

  CheckBox hideCheckBox = new CheckBox("Hide internal servers");
  hideCheckBox.addValueChangeHandler(
      event -> {
        if (event.getValue()) { // if hide = true
          dataProvider.setList(
              runtimeList
                  .stream()
                  .filter(info -> !isNullOrEmpty(info.getPort()))
                  .collect(toList()));
        } else {
          dataProvider.setList(runtimeList);
        }
        dataProvider.refresh();
      });
  hideCheckBox.addStyleName(resources.cellTableStyle().cellTableHideServersCheckBox());
  hideCheckBox.ensureDebugId("runtimeInfoHideServersCheckBox");

  hPanel.add(hideCheckBox);

  panel.add(hPanel);
  panel.add(createCellTable(dataProvider));

  return new ScrollPanel(panel);
}
 
Example 30
Project: onecmdb   File: HeaderScreen.java   Source Code and License Vote up 4 votes
public HeaderScreen() {
    HorizontalPanel outer = new HorizontalPanel();
    VerticalPanel inner = new VerticalPanel();
    outer.setWidth("100%");
    outer.setHeight("3em");
    
    //outer.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    inner.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    inner.setWidth("100%");
    inner.setHeight("100%");
    
    
    HorizontalPanel authInfo = new HorizontalPanel();
    //authInfo.setSpacing(4);
    logout.setStyleName("logout-style");
    authInfo.add(welcomeString);
    authInfo.add(logout);
    logout.setVisible(false);
    logout.addClickListener(this);
    inner.add(authInfo);
 
    HorizontalPanel actionPanel = new HorizontalPanel();
    actionPanel.setStyleName("onecmdb-header-label");
    actionPanel.setSpacing(10);
    actionPanel.add(getFeedbackWidget());
    actionPanel.add(getCheckUpdateWidget());
    
    actionPanel.add(getHomeWidegt());
    actionPanel.add(getHelpWidget());
    
    inner.add(actionPanel);
    inner.setCellVerticalAlignment(actionPanel, VerticalPanel.ALIGN_BOTTOM);
    inner.setCellVerticalAlignment(authInfo, VerticalPanel.ALIGN_TOP);
     
    
    //DockPanel iconPanel = new DockPanel();
    //iconPanel.setWidth("100%");
    //welcomePanel.setSpacing(10);
    //iconPanel.add(icon,DockPanel.EAST);
//    welcomePanel.add(new HTML("<b>&nbsp;</b>"),DockPanel.CENTER);
    outer.add(icon);
    outer.setCellHorizontalAlignment(icon, HorizontalPanel.ALIGN_LEFT);
    outer.add(inner);
    outer.setCellHorizontalAlignment(inner, HorizontalPanel.ALIGN_RIGHT);
    
    
    // Show welcome page.
    icon.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			getBaseEntryScreen().showScreen(OneCMDBApplication.WELCOME_SCREEN);
		}
    });
    
    initWidget(outer);
    //outer.setStyleName("one-top-panel");
  }
 
Example 31
Project: appformer   File: HorizImageListEditorView.java   Source Code and License Vote up 4 votes
@Override
public ImageListEditorView<T> add(final SafeUri uri, final String width, final String height,
                                   final SafeHtml heading, final SafeHtml text, 
                                   final boolean selected, final Command clickCommand) {
    final VerticalPanel panel = new VerticalPanel();
    panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE);
    panel.setHeight("100%");

    final Image image = new Image(uri);
    image.setWidth(width);
    image.setHeight(height);
    image.addStyleName(style.image());
    final double alpha = selected ? 1 : 0.2;
    image.getElement().setAttribute("style", "filter: alpha(opacity=5);opacity: " + alpha);

    final Tooltip tooltip = new Tooltip();
    tooltip.setTitle( text.asString() );
    tooltip.setWidget(image);
    tooltip.setContainer("body");
    tooltip.setPlacement(Placement.BOTTOM);
    tooltip.setIsAnimated(false);
    tooltip.setShowDelayMs(100);

    final HTML label = new HTML(heading.asString());
    final HorizontalPanel labelPanel = new HorizontalPanel();
    labelPanel.setWidth("100%");
    labelPanel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER);
    labelPanel.add(label);

    panel.add(tooltip);
    panel.add(labelPanel);        
    mainPanel.add(panel);

    image.addClickHandler(e -> {
        tooltip.hide();
        tooltip.destroy();
        clickCommand.execute();
    });

    return this;
}