Java 类com.google.gwt.user.client.ui.HorizontalPanel 实例源码

项目:unitimes    文件:WebTable.java   
public IconCell(ImageResource resource, final String title, String text) {
    super(null);
    iIcon = new Image(resource);
    iIcon.setTitle(title);
    iIcon.setAltText(title);
    if (text != null && !text.isEmpty()) {
        iLabel = new HTML(text, false);
        iPanel = new HorizontalPanel();
        iPanel.setStyleName("icon");
        iPanel.add(iIcon);
        iPanel.add(iLabel);
        iIcon.getElement().getStyle().setPaddingRight(3, Unit.PX);
        iPanel.setCellVerticalAlignment(iIcon, HasVerticalAlignment.ALIGN_MIDDLE);
    }
    iIcon.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            event.stopPropagation();
            UniTimeConfirmationDialog.info(title);
        }
    });
}
项目:sig-seguimiento-vehiculos    文件:BasicToolBar.java   
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);
}
项目:sig-seguimiento-vehiculos    文件:JoinDataDialog.java   
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);
}
项目:sig-seguimiento-vehiculos    文件:ActionBar.java   
public ActionBar() {
    super();
    setWidth(300);
    setHeaderVisible(false);
    addStyleName(ThemeStyles.get().style().borderBottom());
    setPosition(0, 0);
    getElement().getStyle().setPosition(Position.ABSOLUTE);
    HorizontalPanel horizontalGroup = new HorizontalPanel();
    horizontalGroup.add(getMenuButton());
    horizontalGroup.add(new SeparatorToolItem());
    Image image = new Image(ImageProvider.INSTANCE.menulogoGeowe());
    horizontalGroup.add(image);
    horizontalGroup.add(new SeparatorToolItem());
    horizontalGroup.add(new SeparatorToolItem());                       
    horizontalGroup.add(getGeocodingButton());
    setWidget(horizontalGroup);     
}
项目:sig-seguimiento-vehiculos    文件:VehicleDialog.java   
private HorizontalPanel createGridPanel() {
    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setSize("510px", "320px");

    vehicleStore = new ListStore<VehicleJSO>(vehicleProps.key());
    vehiculeGrid = createGrid(vehicleStore, vehicleProps);

    vehiculeGrid.getSelectionModel().addSelectionChangedHandler(
            new SelectionChangedHandler<VehicleJSO>() {
                @Override
                public void onSelectionChanged(
                        SelectionChangedEvent<VehicleJSO> event) {
                    List<VehicleJSO> selected = event.getSelection();                       
                    vehicleToolBar.setVehicles(selected);                       
                }
            });

    VerticalLayoutContainer gridContainer = new VerticalLayoutContainer();
    gridContainer.setWidth(500);
    gridContainer.setHeight(320);
    gridContainer.add(vehiculeGrid, new VerticalLayoutData(1, 1));              
    hPanel.add(gridContainer);
    hPanel.add(vehicleToolBar);
    return hPanel;
}
项目:appinventor-extensions    文件:LabeledTextBox.java   
/**
 * Use this TextBox if you want to have text validation while a user is typing
 *
 * @param caption    caption for leading label
 * @param validator  The validator to use for a specific textBox
 */
public LabeledTextBox(String caption, Validator validator) {
  this.validator = validator;

  HorizontalPanel panel = new HorizontalPanel();
  Label label = new Label(caption);
  panel.add(label);
  textbox = new TextBox();
  defaultTextBoxColor = textbox.getElement().getStyle().getBorderColor();
  textbox.setWidth("100%");
  panel.add(textbox);
  panel.setCellWidth(label, "40%");

  HorizontalPanel errorPanel = new HorizontalPanel();
  errorLabel = new Label("");
  errorPanel.add(errorLabel);

  VerticalPanel vp = new VerticalPanel();
  vp.add(panel);
  vp.add(errorPanel);
  vp.setHeight("85px");

  initWidget(vp);

  setWidth("100%");
}
项目:appinventor-extensions    文件:Toolbar.java   
/**
 * 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);
}
项目:appinventor-extensions    文件:TopPanel.java   
private void addLogo(HorizontalPanel panel) {
  // Logo should be a link to App Inv homepage. Currently, after the user
  // has logged in, the top level *is* ODE; so for now don't make it a link.
  // Add timestamp to logo url to get around browsers that agressively cache
  // the image! This same trick is used in StorageUtil.getFilePath().
  Image logo = new Image(LOGO_IMAGE_URL + "?t=" + System.currentTimeMillis());
  logo.setSize("40px", "40px");
  logo.setStyleName("ode-Logo");
  String logoUrl = ode.getSystemConfig().getLogoUrl();
  if (!Strings.isNullOrEmpty(logoUrl)) {
    logo.addClickHandler(new WindowOpenClickHandler(logoUrl));
  }
  panel.add(logo);
  panel.setCellWidth(logo, "50px");
  Label title = new Label("MIT App Inventor");
  title.setStyleName("ode-LogoText");
  VerticalPanel titleContainer = new VerticalPanel();
  titleContainer.add(title);
  panel.add(titleContainer);
  panel.setCellWidth(titleContainer, "180px");
  panel.setCellHorizontalAlignment(logo, HorizontalPanel.ALIGN_LEFT);
  panel.setCellVerticalAlignment(logo, HorizontalPanel.ALIGN_MIDDLE);
}
项目:appinventor-extensions    文件:GalleryAppBox.java   
/**
 * 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);
}
项目:appinventor-extensions    文件:StatusPanel.java   
/**
   * 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");
  }
项目:WebConsole    文件:TabBarComponent.java   
private void loadPage(int pageNo) {
    int displayWidth = WebConsole.getConsoleUnit().getConsoleDisplay().getWidth();

    pageNo = pageNo > pageCount ? pageCount : pageNo;
    currentPage = pageNo;

    // Remove existing items
    hideCurrentItems();

    // Draw the corresponding set of items
    int startIndex = ((pageNo-1) * maxItemsPerPage);

    // Determine width per item and add handlers
    int itemsOnPage = (items.size() - startIndex) > maxItemsPerPage ? maxItemsPerPage : (items.size() - startIndex);
    widthPerItem = (int)Math.floor((double)displayWidth / itemsOnPage);

    for (int i=startIndex; i<(startIndex+(maxItemsPerPage)); i++) {
        if (i >= items.size()) {
            break;
        }
        TabBarItemComponent item = items.get(i);
        item.setWidth(widthPerItem);
        ((HorizontalPanel)getWidget()).add(item);
    }
}
项目:LAS    文件:AlertButton.java   
/**
 * @param title The text that will appear on the button face.
 * @param alertStyle the dependent style suffix that will be appended to the default GWT style when the user is to be alerted.
 */
public AlertButton(String title, String alertStyle) {
    button = new PushButton(title);
    button.addStyleDependentName("SMALLER");
    panel = new HorizontalPanel();
    panel.setBorderWidth(1);
    checkBox = new CheckBox();
    panel.add(button);
    button.setSize("66", "21");
    panel.add(checkBox);
    checkBox.setSize("20", "20");
    ClientFactory cf = GWT.create(ClientFactory.class);
    eventBus = cf.getEventBus();
    this.alertStyle = alertStyle;
    eventBus.addHandler(WidgetSelectionChangeEvent.TYPE, updateNeededEventHandler);
    eventBus.addHandler(VariableSelectionChangeEvent.TYPE, variableChangedEventHandler);
    eventBus.addHandler(UpdateFinishedEvent.TYPE, updateFinishedHandler);
    eventBus.addHandler(MapChangeEvent.TYPE, mapChangeHandler);
    initWidget(panel);
    panel.setSize("90", "23");
    this.ensureDebugId("AlertButton");
}
项目:document-management-system    文件:MailDashboard.java   
/**
 * GeneralDashboard
 */
public MailDashboard() {
    vPanelLeft = new VerticalPanel();
    vPanelRight = new VerticalPanel();
    hPanel = new HorizontalPanel();

    userLastImportedMails = new DashboardWidget("UserLastImportedMails",
            "dashboard.mail.last.imported.mails", "img/email.gif", true, "userLastImportedMails");
    userLastImportedAttachments = new DashboardWidget("UserLastImportedMailAttachments",
            "dashboard.mail.last.imported.attached.documents", "img/email_attach.gif", true,
            "userLastImportedMailAttachments");

    vPanelLeft.add(userLastImportedMails);
    vPanelRight.add(userLastImportedAttachments);

    hPanel.add(vPanelLeft);
    hPanel.add(vPanelRight);

    initWidget(hPanel);
}
项目:document-management-system    文件:WorkflowDashboard.java   
/**
 * UserDashboard
 */
public WorkflowDashboard() {
    vPanelLeft = new VerticalPanel();
    vPanelRight = new VerticalPanel();
    hPanel = new HorizontalPanel();

    hPanel.add(vPanelLeft);
    hPanel.add(vPanelRight);

    pendingTasks = new WorkflowWidget("dashboard.workflow.pending.tasks", "img/icon/workflow.gif", true);
    pendingPooledTasks = new WorkflowWidget("dashboard.workflow.pending.tasks.unassigned", "img/icon/workflow.gif", true);
    pendingTasks.setIsWidgetPendingTask();
    pendingPooledTasks.setIsWidgetPooledTask();
    workflowFormPanel = new WorkflowFormPanel();

    vPanelLeft.add(pendingTasks);
    vPanelLeft.add(pendingPooledTasks);
    vPanelRight.add(workflowFormPanel);

    hPanel.setHeight("100%");
    vPanelRight.setHeight("100%");

    initWidget(hPanel);
}
项目:document-management-system    文件:WorkflowWidget.java   
/**
 * WorkflowWidget
 */
public WorkflowWidget(String name, String uuid, WorkflowWidgetToFire workflowWidgetToFire, Map<String, Object> workflowVariables) {
    this.name = name;
    this.uuid = uuid;
    this.workflowWidgetToFire = workflowWidgetToFire;
    this.workflowVariables = workflowVariables;
    drawed = false;

    vPanel = new VerticalPanel();
    hPanel = new HorizontalPanel();
    manager = new FormManager();

    vPanel.setWidth("300px");
    vPanel.setHeight("50px");

    vPanel.add(new HTML("<br>"));
    vPanel.add(manager.getTable());
    vPanel.add(new HTML("<br>"));

    vPanel.setCellHorizontalAlignment(hPanel, VerticalPanel.ALIGN_CENTER);

    initWidget(vPanel);
}
项目:document-management-system    文件:Status.java   
/**
 * The status
 */
public Status() {
    super(false, true);
    hPanel = new HorizontalPanel();
    image = new Image(OKMBundleResources.INSTANCE.indicator());
    msg = new HTML("");
    space = new HTML("");

    hPanel.add(image);
    hPanel.add(msg);
    hPanel.add(space);

    hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
    hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
    hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
    hPanel.setCellWidth(image, "30px");
    hPanel.setCellWidth(space, "7px");

    hPanel.setHeight("25px");

    msg.setStyleName("okm-NoWrap");

    super.hide();
    setWidget(hPanel);
}
项目:document-management-system    文件:Status.java   
/**
 * Status
 */
public Status() {
    super(false, true);
    hPanel = new HorizontalPanel();
    image = new Image(OKMBundleResources.INSTANCE.indicator());
    msg = new HTML("");
    space = new HTML("");

    hPanel.add(image);
    hPanel.add(msg);
    hPanel.add(space);

    hPanel.setCellVerticalAlignment(image, HasAlignment.ALIGN_MIDDLE);
    hPanel.setCellVerticalAlignment(msg, HasAlignment.ALIGN_MIDDLE);
    hPanel.setCellHorizontalAlignment(image, HasAlignment.ALIGN_CENTER);
    hPanel.setCellWidth(image, "30px");
    hPanel.setCellWidth(space, "7px");

    hPanel.setHeight("25px");

    msg.setStyleName("okm-NoWrap");

    super.hide();
    setWidget(hPanel);
}
项目:Wiab.pro    文件:DialogBox.java   
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
public static void create(UniversalPopup popup, String title, Widget innerWidget,
    DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

  VerticalPanel contents = new VerticalPanel();
  popup.add(contents);

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for (DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
项目:appformer    文件:PrettyFormLayout.java   
public void addHeader(Image img,
                      String name,
                      Image edit) {
    HorizontalPanel h = new HorizontalPanel();
    h.add(img);
    h.add(new HTML("&nbsp;"));
    h.add(new Label(name));
    if (edit != null) {
        h.add(edit);
    }

    Form f = newForm(null);

    f.add(h);
    layout.add(f);
}
项目:sc2gears    文件:ApiUser.java   
private static DialogBox createWaitingDialog( final String message ) {
    final DialogBox dialogBox = new DialogBox();
    dialogBox.setText( "Info" );

    final HorizontalPanel hp = new HorizontalPanel();
    DOM.setStyleAttribute( hp.getElement(), "padding", "20px" );
    hp.setHeight( "20px" );
    hp.add( new Image( "/images/loading.gif" ) );
    hp.add( ClientUtils.createHorizontalEmptyWidget( 5 ) );
    hp.add( new Label( message ) );
    dialogBox.setWidget( hp );

    dialogBox.center();

    return dialogBox;
}
项目:appformer    文件:TableDisplayerView.java   
@Override
public void createTable(int pageSize, FilterLabelSet filterLabelSet) {
    table = new PagedTable<>(pageSize);
    table.pageSizesSelector.setVisible(false);
    table.setEmptyTableCaption(TableConstants.INSTANCE.tableDisplayer_noDataAvailable());
    tableProvider.addDataDisplay(table);

    HTMLElement element = filterLabelSet.getElement();
    element.getStyle().setProperty("margin-bottom", "5px");
    table.getLeftToolbar().add(ElementWrapperWidget.getWidget(filterLabelSet.getElement()));

    exportToCsvButton = new Button("", IconType.FILE_TEXT, e -> getPresenter().export(ExportFormat.CSV));
    exportToXlsButton = new Button("", IconType.FILE_EXCEL_O, e -> getPresenter().export(ExportFormat.XLS));
    exportToCsvButton.setTitle(TableConstants.INSTANCE.tableDisplayer_export_to_csv());
    exportToXlsButton.setTitle(TableConstants.INSTANCE.tableDisplayer_export_to_xls());

    HorizontalPanel rightToolbar = (HorizontalPanel) table.getRightToolbar();
    rightToolbar.insert(exportToCsvButton, 0);
    rightToolbar.insert(exportToXlsButton, 1);
    rootPanel.add(table);
}
项目:riscoss-corporate    文件:RiscossWebApp.java   
public void show() {
    HorizontalPanel h = new HorizontalPanel();
    h.add( new Button( "Cancel", new ClickHandler() {
        @Override
        public void onClick( ClickEvent event ) {
            dialog.hide();
        }} ) );
    panel.add( h );
    dialog.setWidget( panel );
    dialog.setText( "Select Domain" );
    dialog.setPopupPositionAndShow( new PositionCallback() {
        @Override
        public void setPosition( int offsetWidth, int offsetHeight ) {
            dialog.setPopupPosition( offsetWidth /2, offsetHeight /2 );
        }
    } );
}
项目:x-cure-chat    文件:SiteInfoWidget.java   
/**
 * Allows to add the field to the users statistics panel
 */
private void addNewFieldValueWidgetsPair( final HorizontalPanel panel, final String fieldName,
                                          final Label valueLabel, final boolean addComma ) {
    final Label fieldLabel = new Label( fieldName );
    fieldLabel.setWordWrap( false );
    fieldLabel.addStyleName( CommonResourcesContainer.STATISTICS_PANEL_FIELD_STYLE );
    panel.add( fieldLabel );

    panel.add( new HTML("&nbsp;") );

    valueLabel.setWordWrap( false );
    valueLabel.setText("0"); //Set the initial value to be zero
    valueLabel.addStyleName( CommonResourcesContainer.STATISTICS_PANEL_VALUE_STYLE );
    panel.add( valueLabel );

    if( addComma ) {
        Label commaLabel = new Label(",");
        commaLabel.addStyleName( CommonResourcesContainer.STATISTICS_PANEL_FIELD_STYLE );
        panel.add( commaLabel );
    }
    panel.add( new HTML("&nbsp;") );
}
项目:mvp4g-examples    文件:CompanyRowView.java   
public CompanyRowView() {

        name = new Label();

        display = new Image( "images/display.png" );
        quickEdit = new Image( "images/quickEdit.png" );
        edit = new Image( "images/edit.png" );
        delete = new Image( "images/delete.png" );

        HorizontalPanel hp = new HorizontalPanel();
        hp.setSpacing( 2 );
        hp.add( name );
        hp.add( display );
        hp.add( quickEdit );
        hp.add( edit );
        hp.add( delete );

        initWidget( hp );

    }
项目:appformer    文件:ColumnListEditorView.java   
@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;
}
项目:onecmdb    文件:FooterScreen.java   
public FooterScreen() {
    HorizontalPanel panel = new HorizontalPanel();
    HTML label = new HTML("OneCMDB 1.4.0 Beta &copy; Lokomo Systems <<a href='javascript:;'>about</a>>");
    label.setTitle("Show about screen");
    label.setStyleName("onecmdb-footer-label");
    panel.add(label);
    panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT);
    panel.setStyleName("onecmdb-footer");
    label.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {
            getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT, 
                    "about.html", 
                    new Long(0));
        }

    });
    initWidget(panel);
}
项目:firefly    文件:FilterPanel.java   
protected void layout() {

        valueDisplay.insert(textInput, TEXT);
        valueDisplay.insert(enumInput, ENUM);

        HorizontalPanel selectPanel = new HorizontalPanel();
        selectPanel.add(colsField);
        selectPanel.add(GwtUtil.getFiller(18, 0));
        selectPanel.add(opsField);
        selectPanel.add(GwtUtil.getFiller(6, 0));

        HorizontalPanel cmds = new HorizontalPanel();
        cmds.add(remove);
        cmds.add(removeAll);

        mainPanel.setCellSpacing(5);
        mainPanel.setWidget(0, 0, selectPanel);
        mainPanel.setWidget(0, 1, valueDisplay);
        mainPanel.setWidget(1, 0, display);
        mainPanel.setWidget(2, 0, add);
        mainPanel.setWidget(3, 0, cmds);
        mainPanel.getFlexCellFormatter().setRowSpan(0, 1, 2);
        mainPanel.getFlexCellFormatter().setRowSpan(1, 0, 2);
        mainPanel.getFlexCellFormatter().setVerticalAlignment(0, 1, VerticalPanel.ALIGN_TOP);
        mainPanel.getFlexCellFormatter().setVerticalAlignment(2, 0, VerticalPanel.ALIGN_TOP);
    }
项目:riscoss-corporate    文件:RiskAnalysisWizard.java   
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());
    }
}
项目:firefly    文件:WebGridLayer.java   
public void setShowing(boolean show, boolean showHelp) {
    if (_showing!=show) {
        _showing = show;
        if (show) {
            _pv.addWebLayerItem(_layer);
            _grid.setUseLabels(useLabels);
            _showing= _grid.paint();

            if (showHelp) {
                VisIconCreator ic= VisIconCreator.Creator.getInstance();
                Image im= new Image(ic.getLayerBright());
                HorizontalPanel hp= new HorizontalPanel();
                hp.add(im);
                hp.add(new HTML("To change coordinate system or color click on the layer button"));
                _showOnce.message(_pv, hp);
            }
        }
        else {
            _pv.removeWebLayerItem(_layer);
            _grid.clear();
        }
        _pv.fireEvent(new WebEvent(this,Name.GRID_ANNOTATION));

    }

}
项目:riscoss-corporate    文件:EntitiesListBox.java   
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());
    }
}
项目:mgwt-traffic-flow    文件:ColorPickerDialog.java   
@Override
protected Widget createDialogArea() {
    setText("Select Color");

    HorizontalPanel panel = new HorizontalPanel();

    // the pickers
    slPicker = new SaturationLightnessPicker();
    panel.add(slPicker);
    huePicker = new HuePicker();
    panel.add(huePicker);

    // bind saturation/lightness picker and hue picker together
    huePicker.addHueChangedHandler(new IHueChangedHandler() {
        public void hueChanged(HueChangedEvent event) {
            slPicker.setHue(event.getHue());
        }
    });

    return panel;
}
项目:gwtlib    文件:PagingBar.java   
protected void updateBrowserWidget(Widget widget) {
  HorizontalPanel panel = (HorizontalPanel)widget;
  int minpage = _page > 2 ? _page - 2 : 0;
  int maxpage = minpage + 4;
  if(maxpage >= _pages) {
    maxpage = _pages - 1;
    minpage = _pages > 4 ? _pages - 4 : 0;
  }
  panel.clear();
  panel.add(createBrowserItemWidget(FIRST, _page > 0));
  panel.add(createBrowserItemWidget(PREV, _page > 0));
  for(int i = minpage; i <= maxpage; ++i) {
    panel.add(createBrowserItemWidget(String.valueOf(i + 1), i != _page));
  }
  panel.add(createBrowserItemWidget(NEXT, _page < _pages - 1));
  panel.add(createBrowserItemWidget(LAST, _page < _pages - 1));
  widget.setVisible(_size > 0);
}
项目:optaplanner-wb    文件:BendableConstraintMatchRuleModellerWidget.java   
private HorizontalPanel createSelectPanel() {
    HorizontalPanel selectPanel = new HorizontalPanel();

    constraintLevelTextBox.getElement().setAttribute("type",
                                                     "number");
    constraintLevelTextBox.getElement().setAttribute("min",
                                                     "0");
    constraintLevelTextBox.getElement().getStyle().setWidth(40,
                                                            Style.Unit.PX);
    constraintLevelTextBox.setEnabled(false);
    constraintLevelTextBox.setValue(String.valueOf(actionConstraintMatch.getPosition()));
    constraintLevelTextBox.addValueChangeHandler(s -> actionConstraintMatch.setPosition(Integer.parseInt(s.getValue())));
    selectPanel.add(constraintLevelTextBox);

    constraintLevelSelectHelpIcon.setVisible(false);
    constraintLevelSelectHelpIcon.getElement().getStyle().setPaddingLeft(5,
                                                                         Style.Unit.PX);

    selectPanel.add(constraintLevelSelectHelpIcon);

    return selectPanel;
}
项目:optaplanner-wb    文件:MultiConstraintHardSoftMatchRuleModellerWidget.java   
private HorizontalPanel getItemPanel(final String labelText,
                                     final IsWidget constraintWidget) {
    HorizontalPanel horizontalPanel = new HorizontalPanel();

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

    horizontalPanel.add(constraintWidget);

    horizontalPanel.setWidth("100%");
    horizontalPanel.setCellWidth(labelPanel,
                                 "150px");

    return horizontalPanel;
}
项目:fullmetalgalaxy    文件:AppMain.java   
/**
 * 
 */
public AppMain()
{
  super();
  s_instance = this;
  loadAccountInfoFromPage();

  HorizontalPanel hPanel = new HorizontalPanel();
  hPanel.add( new Image( Icons.s_instance.takeOff32() ) );
  hPanel.add( new Label( MAppBoard.s_messages.unconnected() ) );
  m_pnlChannelDisconnected = new FocusPanel( hPanel );


  // disconnect if leaving this page
  Window.addWindowClosingHandler( this );
}
项目:riscoss-corporate    文件:RolePropertyPage.java   
public RolePropertyPage() {
    HorizontalPanel toolbar = new HorizontalPanel();
    toolbar.add( new Button( "Add User", new ClickHandler() {
        @Override
        public void onClick( ClickEvent event ) {
            onNewUserClicked();
        }
    } ) );

    userList = new UserList("");

    DockPanel dock = new DockPanel();
    dock.add( toolbar,DockPanel.NORTH );
    dock.add( userList, DockPanel.CENTER );

    tabPanel.add( new SimplePanel(), "Role Properties" );
    tabPanel.add( dock, "Users" );

    panel.setWidget( tabPanel );
}
项目:onecmdb    文件:InheritanceTreeControl.java   
public Widget getWidget(Object data) {
    if (!(data instanceof GWT_CiBean)) {
        return(new Label("getChildCount(Object data): Not a correct data object!"));
    }
    GWT_CiBean bean = (GWT_CiBean)data;
    final HorizontalPanel hpanel =  new HorizontalPanel();
    hpanel.add(new CIIconDisplayNameWidget(bean, getClickListener()));
    //hpanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
    //hpanel.add(new CIDisplayNameWidget(bean, getClickListener()));
    getInstanceCount(bean, new AsyncCallback() {

        public void onFailure(Throwable caught) {
        }

        public void onSuccess(Object result) {
            if (result instanceof Integer) {
                HTML instances = new HTML("[" + result + "]");
                instances.setStyleName("onecmdb-tree-counter-decoration");
                instances.setTitle("Total number of instances for this template");
                hpanel.add(instances);
            }
        }

    });
    return(hpanel);
}
项目:onecmdb    文件:SelectInheritanceDataSourceControl.java   
/**
 * Override widget to add check box button.
 */
public Widget getWidget(Object data) {
    if (!(data instanceof GWT_CiBean)) {
        return(new Label("getChildCount(Object data): Not a correct data object!"));
    }
    final GWT_CiBean bean = (GWT_CiBean)data;
    HorizontalPanel hpanel =  new HorizontalPanel();
    hpanel.add(new Image(OneCMDBUtils.getIconForCI(bean)));
    Label label = new Label(bean.getDisplayName());
    hpanel.add(label);
    //final Image popup = new Image("images/select_me.gif");
    //hpanel.add(popup);
    label.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            if (callback != null) {
                if (selectInstances != bean.isTemplate()) {
                    return;
                }
                callback.onSelect(bean);
            }
        }
    });
    return(hpanel);
}
项目:appformer    文件:ColorPickerDialog.java   
@Override
protected Widget createDialogArea() {
    setText(CommonConstants.INSTANCE.ColorPickerTitle());

    HorizontalPanel panel = new HorizontalPanel();

    // the pickers
    slPicker = new SaturationLightnessPicker();
    panel.add(slPicker);
    huePicker = new HuePicker();
    panel.add(huePicker);

    // bind saturation/lightness picker and hue picker together
    huePicker.addHueChangedHandler(new HueChangedHandler() {
        public void hueChanged(HueChangedEvent event) {
            slPicker.setHue(event.getHue());
        }
    });

    return panel;
}
项目:firefly    文件:Form.java   
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);
}