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

项目:EasyML    文件:FileUploader.java   
public void init() {

        uploader.setButtonImageURL("img/uploadimg.png").setButtonWidth(32)
        .setButtonHeight(32)
        .setButtonCursor(Uploader.Cursor.HAND);

        horizontalPanel.setStyleName("bda-fileupload-bottom-hpanel");
        horizontalPanel.setSpacing(10);
        horizontalPanel.add(uploader);
        if (Uploader.isAjaxUploadWithProgressEventsSupported()) {

            dropFilesLabel.getElement().getStyle().setCursor(Cursor.POINTER);
            dropFilesLabel.setSize("32px", "32px");
            dropFilesLabel.setTitle("File dragable upload area");
        }
        horizontalPanel.add(dropFilesLabel);
        horizontalPanel.add(progressBarPanel);
        horizontalPanel.setCellVerticalAlignment(progressBarPanel,
                HasVerticalAlignment.ALIGN_MIDDLE);
        this.add(horizontalPanel);
        initFacet();
    }
项目: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);
        }
    });
}
项目:unitimes    文件:WebTable.java   
public IconsCell add(ImageResource resource, final String title) {
    if (resource == null) return this;
    Image icon = new Image(resource);
    icon.setTitle(title);
    icon.setAltText(title);
    if (iPanel.getWidgetCount() > 0)
        icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
    iPanel.add(icon);
    iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
    if (title != null && !title.isEmpty()) {
        icon.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                event.stopPropagation();
                UniTimeConfirmationDialog.info(title);
            }
        });
    }
    return this;
}
项目: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    文件:LayerCatalogDialog.java   
private ColumnModel<LayerDef> createColumnList(LayerDefProperties props, 
        RowExpander<LayerDef> rowExpander) {

    rowExpander.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    rowExpander.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    ColumnConfig<LayerDef, String> nameColumn = new ColumnConfig<LayerDef, String>(
            props.name(), 200, SafeHtmlUtils.fromTrustedString("<b>"
                    + UIMessages.INSTANCE.layerManagerToolText() + "</b>"));
    nameColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);     

    ColumnConfig<LayerDef, String> typeColumn = new ColumnConfig<LayerDef, String>(
            props.type(), 75, UICatalogMessages.INSTANCE.type());
    typeColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    typeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);     

    ColumnConfig<LayerDef, ImageResource> iconColumn = new ColumnConfig<LayerDef, ImageResource>(
            props.icon(), 32, "");
    iconColumn.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    iconColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    iconColumn.setCell(new ImageResourceCell() {
        @Override
        public void render(Context context, ImageResource value, SafeHtmlBuilder sb) {
            super.render(context, value, sb);
        }
    });

    List<ColumnConfig<LayerDef, ?>> columns = new ArrayList<ColumnConfig<LayerDef, ?>>();
    columns.add(rowExpander);
    columns.add(iconColumn);        
    columns.add(nameColumn);
    columns.add(typeColumn);        

    return new ColumnModel<LayerDef>(columns);
}
项目:LAS    文件:CancelButton.java   
public CancelButton(String panel_id) {
    final String id = panel_id;
    cancel.setWidth("75px");
    cancel.addStyleDependentName("SMALLER");
    cancel.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent click) {
            eventBus.fireEvent(new CancelEvent(id));
        }
    });
    CellFormatter f = interior.getCellFormatter();
    f.setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    f.setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP);
    f.setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_TOP);

    interior.setWidget(0, 0, batch);
    interior.setWidget(1, 0, message);
    interior.setWidget(2, 0, cancel);

    sizePanel.add(interior);

    initWidget(sizePanel);
}
项目:LAS    文件:BaseUI.java   
/**
 * @param flexTable
 * 
 */
void setTopLeftAlignment(FlexTable flexTable) {
    if (flexTable != null) {
        int rows = flexTable.getRowCount();
        for (int row = 0; row < rows; row++) {
            int cellCount = flexTable.getCellCount(row);
            for (int col = 0; col < cellCount; col++) {
                if (flexTable.isCellPresent(row, col)) {
                    flexTable.getCellFormatter().setHorizontalAlignment(row, col, HasHorizontalAlignment.ALIGN_LEFT);
                    flexTable.getCellFormatter().setVerticalAlignment(row, col, HasVerticalAlignment.ALIGN_TOP);
                    Widget widget = flexTable.getWidget(row, col);
                    if ((widget != null) && (widget.getClass().getName().equals("FlexTable"))) {
                        try {
                            setTopLeftAlignment((FlexTable) widget);
                        } catch (Exception e) {
                           // e.printStackTrace();
                        }
                    }
                }
            }
        }
    }
}
项目:firefly    文件:BasicImageGrid.java   
protected void handleDoubleClick(TableData.Row row) {
    VerticalPanel vp = new VerticalPanel();
    final Image previewImage = new Image(getFullSizeUrl(row));
    final HTML caption = new HTML(getPopUpCaption(row));
    String title = getThumbnailDesc(row).replace("<em>", "").replace("</em>", "");

    caption.setWidth("320px");

    previewImage.addLoadHandler(new LoadHandler() {
        public void onLoad(LoadEvent ev) {
            caption.setWidth(previewImage.getWidth() + "px");
        }
    });
    GwtUtil.setStyle(vp, "margin", "8px");

    vp.setCellHorizontalAlignment(previewImage, HasHorizontalAlignment.ALIGN_CENTER);
    vp.setCellVerticalAlignment(previewImage, HasVerticalAlignment.ALIGN_MIDDLE);
    vp.add(previewImage);
    vp.add(caption);

    PopupPane popupPane = new PopupPane(title, vp, PopupType.STANDARD, false, false);

    popupPane.show();
}
项目:x-cure-chat    文件:ForumMessageWidget.java   
protected void addNewFieldValuePair( final FlowPanel content, final String fieldName,
                                   final Date dateValue, final boolean addEndCommaDelimiter ) {
    final Label fieldLabel = new Label( fieldName );
    fieldLabel.setStyleName( CommonResourcesContainer.USER_DIALOG_REGULAR_FIELD_STYLE );
    final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat( PredefinedFormat.DATE_TIME_SHORT );
    final Label dateTimeLabel = new Label( dateTimeFormat.format( dateValue ) );
    dateTimeLabel.setStyleName( CommonResourcesContainer.CONST_FIELD_VALUE_DEFAULT_STYLE_NAME );
    final int width = ( dateTimeLabel.getOffsetWidth() == 0 ? DEFAULT_PROGRESS_BAR_WIDTH_PIXELS : dateTimeLabel.getOffsetWidth() );
    DateOldProgressBarUI progressBarUI= new DateOldProgressBarUI( width, DEFAULT_PROGRESS_BAR_HEIGHT_PIXELS, dateValue );

    //If there are replies to this message
    VerticalPanel dateTimePanel = new VerticalPanel();
    dateTimePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
    dateTimePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
    dateTimePanel.add( dateTimeLabel );
    dateTimePanel.add( progressBarUI );

    //Add the widgets to the panel
    addNewFieldValuePair( content, fieldLabel, dateTimePanel, addEndCommaDelimiter );
}
项目:unitime    文件:WebTable.java   
public IconsCell add(ImageResource resource, final String title) {
    if (resource == null) return this;
    Image icon = new Image(resource);
    icon.setTitle(title);
    icon.setAltText(title);
    if (iPanel.getWidgetCount() > 0)
        icon.getElement().getStyle().setPaddingLeft(3, Unit.PX);
    iPanel.add(icon);
    iPanel.setCellVerticalAlignment(icon, HasVerticalAlignment.ALIGN_MIDDLE);
    if (title != null && !title.isEmpty()) {
        icon.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                event.stopPropagation();
                UniTimeConfirmationDialog.info(title);
            }
        });
    }
    return this;
}
项目:x-cure-chat    文件:MessagesStackNavigator.java   
private void populate() {
    //Add the scroll panel
    elementPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
    elementPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
    scrollPanel.add( elementPanel );

    //Initialize the widget
    scrollPanel.setWidth("100%");
    scrollPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
    scrollPanel.addStyleName( CommonResourcesContainer.STACK_NAVIGATOR_SCROLL_PANEL_ELEMENT_STYLE );

    //Set the simple panel
    setComponentWidget( scrollPanel );

    //Set the height of the panel to be 40 pixels
    addDecPanelStyle(CommonResourcesContainer.STACK_NAVIGATOR_DEC_PANEL_ELEMENT_STYLE);
}
项目:x-cure-chat    文件:YoutubeLinksHandlerUtils.java   
/**
 * Allows to get a flash object for the youtube video url
 * @param yutubeMediaUrl the youtube video url
 * @param youtubeURL the original youtube link url
 * @param isInitiallyBlocked is true if the flash should be initially blocked
 * @return the corresponding flash object widget
 */
public static Widget getYoutubeEmbeddedFlashObject( final String yutubeMediaUrl, final String youtubeURL, final boolean isInitiallyBlocked ) {
    //Construct the youtube embedded object descriptor
    FlashEmbeddedObject flashObject = new FlashEmbeddedObject(  null );
    flashObject.setMovieUrl( yutubeMediaUrl );
    flashObject.completeEmbedFlash();

    //Make the widget out of a wrapped youtube video plus the video URL.
    VerticalPanel mainPanel = new VerticalPanel();
    mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
    mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
    mainPanel.add( new FlashObjectWrapperUI( flashObject.toString(), isInitiallyBlocked, null ) );
    mainPanel.add( new URLWidget( youtubeURL, false, false ) );

    return mainPanel;
}
项目:geowe-core    文件:FeatureGrid.java   
protected ColumnModel<VectorFeature> createColumnList(List<VectorFeature> features) {
    List<ColumnConfig<VectorFeature, ?>> columns = new ArrayList<ColumnConfig<VectorFeature, ?>>();

    if(features != null && features.size() > 0) {
        VectorFeature feature = features.get(0);

        if(feature.getAttributes() != null) {
            for(String attributeName : feature.getAttributes().getAttributeNames()) {   
                AttributeValueProvider attributeProvider = new AttributeValueProvider(attributeName);

                ColumnConfig<VectorFeature, String> attributeColumn = new ColumnConfig<VectorFeature, String>(
                        attributeProvider, 100, attributeName);
                attributeColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
                if(isEnableCellRender()) {
                    attributeColumn.setCell(new FeatureGridCellRenderer());
                }                   

                columns.add(attributeColumn);
            }
        }                   
    }

    return new ColumnModel<VectorFeature>(columns);
}
项目:mvp4g-examples    文件:TopBarView.java   
@Override
protected Widget createWidget() {
    HorizontalPanel mainPanel = new HorizontalPanel();

    save.setValue( true );

    mainPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
    mainPanel.add( new Label( "Products :" ) );
    mainPanel.add( products );
    mainPanel.add( showProduct );
    mainPanel.add( new Label( "Deals :" ) );
    mainPanel.add( deals );
    mainPanel.add( showDeal );
    mainPanel.add( save );

    mainPanel.setStyleName( "bar" );

    return mainPanel;
}
项目:x-cure-chat    文件:ViewUserProfileDialogUI.java   
/**
 * Fills the main grid data
 */
protected void populateDialog(){
    addMainDataFields();
    addImagesDataGrid();
    addOptionalDataFields();
    addAboutMyselfPanel();
    //Add send message and is friend grid if we are not browsing ourselves
    if( SiteManager.getUserID() != userID ) { 
        addSendMsgAddRemoveFriendActionFields();
    } else {
        //Add the progress bar for viewing ourselve's profile
        addNewGrid( 1, 1, false, "", false);
        HorizontalPanel progressBarPanel = new HorizontalPanel();
        progressBarPanel.setWidth("100%");
        progressBarPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
        progressBarPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
        progressBarPanel.add( progressBarUI );
        addToGrid( FIRST_COLUMN_INDEX, progressBarPanel, false , false );
    }
}
项目:x-cure-chat    文件:ShortUserInfoPopupPanel.java   
/**
 * Allows to add a small panel containing the "View Full Profile" link,
 * this is made for those who are not smart enough to click on the login
 * name in this dialog again, to get to a full profile view  
 */
private void addViewUserProfileLink() {
    //Initialize the link
    Label userProfileLink = new Label(I18NManager.getTitles().viewFullUserProfileLinkTitle());
    userProfileLink.setWordWrap(false);
    userProfileLink.setStyleName( CommonResourcesContainer.DIALOG_LINK_RED_STYLE );
    userProfileLink.addClickHandler( this.userProfileShowHandler );

    //Initialize the panel
    HorizontalPanel userProfileLinkPanel = new HorizontalPanel();
    userProfileLinkPanel.setStyleName( CommonResourcesContainer.VIEW_USER_PROFILE_LINK_PANEL_STYLE );
    userProfileLinkPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
    userProfileLinkPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
    userProfileLinkPanel.add( userProfileLink );

    //Add the profile view link panel to the main panel
    mainInfoVPanel.add( userProfileLinkPanel );
}
项目:x-cure-chat    文件:ChatMessageAvatarUI.java   
/**
 * The basic constructor
 * @param roomID the id of the room in which this avatar is shown
 */
private ChatMessageAvatarUI( final int roomID ) {
    mainVerticalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
    mainVerticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
    avatarWrapperPanel.add( avatarImageWidget );
    mainVerticalPanel.add( avatarWrapperPanel );
    mainVerticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
    avatarTitleLabel.setWordWrap( false );
    avatarTitleLabel.setStyleName( CommonResourcesContainer.USER_NAME_AVATAR_STYLE );
    mainVerticalPanel.add( avatarTitleLabel );
    mainFocusPanel.add( mainVerticalPanel );

    this.roomID = roomID;

    //All composites must call initWidget() in their constructors.
    initWidget( mainFocusPanel );       
}
项目:x-cure-chat    文件:ChatMessagesPanelUI.java   
/**
 * The basic constructor
 * @param roomID the id of the room to which this messages panel belongs
 */
public ChatMessagesPanelUI( final int roomID ) {
    //Store the room's ID
    this.roomID = roomID;

    //Set interface components
    table.setStyleName( CommonResourcesContainer.CHAT_MESSAGES_TABLE_STYLE_NAME );
    VerticalPanel bottomAlignmentPanel = new VerticalPanel();
    bottomAlignmentPanel.addStyleName( CommonResourcesContainer.CHAT_MESSAGES_VERTICAL_ALIGN_PANEL_STYLE_NAME );
    bottomAlignmentPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
    bottomAlignmentPanel.add( table );

    msgsScrollPanel.add( bottomAlignmentPanel );
    msgsScrollPanel.setStyleName( CommonResourcesContainer.CHAT_MESSAGES_SCROLL_PANEL_STYLE_NAME );

    /*Initialize the composite widget*/
    initWidget( msgsScrollPanel );
}
项目:firefly    文件:GwtUtil.java   
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;
}
项目:geowe-core    文件: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);
}
项目:ephesoft    文件:FuzzyDBPropertiesView.java   
/**
 * Constructor.
 */
public FuzzyDBPropertiesView() {
    super();
    initWidget(BINDER.createAndBindUi(this));
    detailTable = new FlexTable();
    detailTable.setWidth("100%");
    detailTable.getColumnFormatter().setWidth(0, "40%");
    detailTable.getColumnFormatter().setWidth(1, "1%");
    detailTable.getColumnFormatter().setWidth(2, "59%");
    viewTable.setWidget(0, 0, detailTable);
    viewTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    edit.setText(AdminConstants.EDIT_BUTTON);
    mappingButton.setText(AdminConstants.MAPPING_BUTTON);
    mappingButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent arg0) {
            presenter.getController().getMainPresenter().showDocTypeMappingView();
        }
    });
}
项目:ephesoft    文件:PluginDetailPresenter.java   
/**
 * Processing to be done on load of this presenter.
 */
@Override
public void bind() {
    if (controller.getSelectedPlugin() != null) {
        this.dataTable = view.getViewTable();
        viewTable = new FlexTable();
        viewTable.setWidth("80%");
        viewTable.setCellSpacing(0);
        viewTable.getColumnFormatter().setWidth(0, "40%");
        viewTable.getColumnFormatter().setWidth(1, "1%");
        viewTable.getColumnFormatter().setWidth(2, "59%");
        dataTable.setWidget(0, 0, viewTable);
        dataTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
        setProperties();
        if (controller.getSelectedPlugin().getPlugin().getPluginName().equalsIgnoreCase(PluginNameConstants.CMIS_EXPORT_PLUGIN)) {
            view.getTestCMIS().setVisible(Boolean.TRUE);
        } else {
            view.getTestCMIS().setVisible(Boolean.FALSE);
        }
        enableCMISGetTokenButton();
    }
}
项目:ephesoft    文件:KV_PP_DetailPresenter.java   
private void setProperties() {
    int row = 0;
    Collection<BatchClassPluginConfigDTO> values = controller.getSelectedPlugin().getBatchClassPluginConfigs();
    if (values != null) {
        for (BatchClassPluginConfigDTO pluginDTO : values) {
            if (!pluginDTO.getPluginConfig().getFieldName().equals(BatchClassManagementConstants.KV_PAGE_PROCESS_CONFIG_NAME)) {
                viewTable.setWidget(row, 0, new Label(pluginDTO.getDescription() + BatchClassManagementConstants.COLON));
                viewTable.setWidget(row, 2, new Label(pluginDTO.getValue()));
                viewTable.getFlexCellFormatter().addStyleName(row, 0, "bold_text");
                viewTable.getFlexCellFormatter().setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT,
                        HasVerticalAlignment.ALIGN_MIDDLE);
                row++;
            }
        }
    }
}
项目:ephesoft    文件:KV_PP_DetailPresenter.java   
/**
 * Processing to be done on load of this presenter.
 */
@Override
public void bind() {
    if (controller.getSelectedPlugin() != null) {
        this.dataTable = view.getViewTable();
        this.viewTable = new FlexTable();
        viewTable.setWidth("80%");
        viewTable.setCellSpacing(0);
        viewTable.getColumnFormatter().setWidth(0, "40%");
        viewTable.getColumnFormatter().setWidth(1, "1%");
        viewTable.getColumnFormatter().setWidth(2, "59%");
        dataTable.setWidget(0, 0, viewTable);
        dataTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
        setProperties();
    }
}
项目:ephesoft    文件:PluginDataPresenter.java   
/**
 * Processing to be done on load of this presenter.
 */
@Override
public void bind() {
    if (controller.getSelectedPlugin() != null) {
        this.dataTable = view.getViewTable();
        viewTable = new FlexTable();
        viewTable.setWidth("100%");
        viewTable.setCellSpacing(0);
        viewTable.getColumnFormatter().setWidth(0, "10%");
        viewTable.getColumnFormatter().setWidth(1, "1%");
        viewTable.getColumnFormatter().setWidth(2, "70%");
        viewTable.getFlexCellFormatter().addStyleName(0, 0, "topBorder");
        viewTable.getFlexCellFormatter().addStyleName(0, 1, "topBorder");
        viewTable.getFlexCellFormatter().addStyleName(0, 2, "topBorder");
        dataTable.setWidget(0, 0, viewTable);
        dataTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
        setProperties();
    }
}
项目:ephesoft    文件:ScannerDetailPresenter.java   
private void setProperties() {
    int row = 0;
    Collection<WebScannerConfigurationDTO> values = controller.getSelectedWebScannerConfiguration().getChildren();
    if (values != null) {

        // handling for profile name field
        dataTable.setWidget(row, 0, new Label(controller.getSelectedWebScannerConfiguration().getDescription()
                + BatchClassManagementConstants.COLON));
        dataTable.setWidget(row, 2, new Label(controller.getSelectedWebScannerConfiguration().getValue()));
        dataTable.getFlexCellFormatter().addStyleName(row, 0, "bold_text");
        dataTable.getFlexCellFormatter().setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT,
                HasVerticalAlignment.ALIGN_MIDDLE);
        row++;

        for (WebScannerConfigurationDTO dto : values) {
            dataTable.setWidget(row, 0, new Label(dto.getDescription() + BatchClassManagementConstants.COLON));
            dataTable.setWidget(row, 2, new Label(dto.getValue()));
            dataTable.getFlexCellFormatter().addStyleName(row, 0, "bold_text");
            dataTable.getFlexCellFormatter().setAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT,
                    HasVerticalAlignment.ALIGN_MIDDLE);
            row++;
        }
    }
}
项目:ephesoft    文件:EditScannerPresenter.java   
/**
 * Processing to be done on load of this presenter.
 */
@Override
public void bind() {
    if (controller.getSelectedWebScannerConfiguration() == null) {
        WebScannerConfigurationDTO configDTO = controller.getMainPresenter().getBatchClassViewPresenter()
                .createScannerConfigurationDTOObject();
        // controller.setAdd(true);
        controller.setSelectedWebScannerConfiguration(configDTO);
    }

    view.setView();
    FlexTable dataTable = view.getDataTable();
    dataTable.getColumnFormatter().setWidth(0, "40%");
    dataTable.getColumnFormatter().setWidth(1, "1%");
    dataTable.getColumnFormatter().setWidth(2, "59%");
    dataTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);
    setProperties();
    if (docFieldWidgets.get(0) != null) {
        docFieldWidgets.get(0).getTextBoxWidget().getWidget().setFocus(true);
    }
}
项目:gwtlib    文件:ShowcaseEntryPoint.java   
private void init(RootPanel root) {
  _deckPanel = new DeckPanel();
  _tree = createTree();
  _tree.addSelectionHandler(new SelectionHandler<TreeItem>() {
    public void onSelection(SelectionEvent<TreeItem> event) {
      TreeItem item = event.getSelectedItem();
      if(item.getUserObject() != null) {
        ContentWidget widget = (ContentWidget)item.getUserObject();
        widget.init();
        int i = _deckPanel.getWidgetIndex(widget);
        if(i != -1) _deckPanel.showWidget(i);
      }
    }
  });

  FlexTable table = new FlexTable();
  table.setWidget(0, 0, _tree);
  table.setWidget(0, 1, _deckPanel);
  table.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP);

  root.add(table);
}
项目:ephesoft    文件:TableExtractionView.java   
private void addHeaderColumns(final List<Column> columnList, final FlexTable flexTable) {
    tableNameVsCheckBoxMap.get(selectedDataTableName).clear();
    int columnNumber = 0;
    for (Column headerColumn : columnList) {
        HorizontalPanel headerRowPanel = new HorizontalPanel();
        Label headerText = new Label(headerColumn.getName());
        headerRowPanel.add(headerText);
        headerRowPanel.setWidth("80px");
        CheckBox validationCheckBox = new CheckBox();
        validationCheckBox.setVisible(Boolean.FALSE);
        headerRowPanel.add(validationCheckBox);
        headerRowPanel.setCellVerticalAlignment(validationCheckBox, HasVerticalAlignment.ALIGN_MIDDLE);
        tableNameVsCheckBoxMap.get(selectedDataTableName).add(validationCheckBox);
        flexTable.setWidget(0, columnNumber, headerRowPanel);
        flexTable.getCellFormatter().addStyleName(0, columnNumber, "wordWrap");
        columnNumber++;
    }
}
项目:ephesoft    文件:EditDependencyView.java   
/**
 * 
 */
private void addCssStyle() {
    editDependencyPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    editDependencyPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    andButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX);
    orButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX);
    buttonsPanel.setSpacing(CustomWorkflowConstants.SPACING_15);
    dependenciesList.setVisibleItemCount(CustomWorkflowConstants.VISIBLE_ITEM_10);
    dependenciesListHorizontalPanel.add(dependenciesList);
    dependenciesTextArea.setSize(CustomWorkflowConstants._280PX, CustomWorkflowConstants._147PX);
    dependenciesTextArea.setTextAlignment(TextArea.ALIGN_JUSTIFY);
    editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.CUSTOM_WORKFLOW_PANEL);
    editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.MAIN_PANEL_LAYOUT);

    pluginLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
    dependencyTypeLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
    dependenciesLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
    pluginNamesList.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
}
项目:ephesoft    文件:FolderTableView.java   
/**
 * This method adds message to table when no content is present at selected location.
 */
public void addNoContentLabel() {
    Label noContentLabel = new Label(LocaleDictionary.get().getMessageValue(FolderManagementMessages.NO_CONTENT_MESSAGE));
    final Label emptyLabelCol1 = new Label();
    final Label emptyLabelCol3 = new Label();
    final Label emptyLabelCol4 = new Label();

    emptyLabelCol1.setWidth(PERCENTAGE_FIVE);
    emptyLabelCol3.setWidth(PERCENTAGE_TWENTY_EIGHT);
    emptyLabelCol4.setWidth(PERCENTAGE_NINE);
    folderDisplayTable.setWidget(0, 0, emptyLabelCol1);
    folderDisplayTable.setWidget(0, 2, emptyLabelCol3);
    folderDisplayTable.setWidget(0, 3, emptyLabelCol4);
    folderDisplayTable.setWidget(0, 1, noContentLabel);
    folderDisplayTable.getCellFormatter()
            .setAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE);
    setEnableAttributeForTableContent(false);
}
项目:sandbox-frame    文件:ProjectViewImpl.java   
@Override
public void setPlatforms(List<Platform> platforms) {
    for (int i=0;i<platforms.size();i++) {
        Platform platform = platforms.get(i);
        Image image = new Image(Utils.getPlatformIcon(platform));
        image.setTitle(Utils.getPlatformText(platform));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getPlatformText(platform));
        platformsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        platformsPanel.add(image);
        platformsPanel.setCellWidth(image, "32px");
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        platformsPanel.add(label);
        if (i < platforms.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
    }
}
项目:sandbox-frame    文件:ProjectViewImpl.java   
@Override
public void setFeatures(List<Feature> features) {
    for (int i=0;i<features.size();i++) {
        Feature feature = features.get(i);
        Image image = new Image(Utils.getFeatureIcon(feature));
        image.setTitle(Utils.getFeatureText(feature));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getFeatureText(feature));
        featuresPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        featuresPanel.add(image);
        featuresPanel.setCellWidth(image, "32px");
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        featuresPanel.add(label);
        if (i < features.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);

    }
}
项目:sandbox-frame    文件:ProjectBundleViewImpl.java   
@Override
public void setSdkLanguages(List<SdkLanguage> sdkLanguages) {
       for (int i=0;i<sdkLanguages.size();i++) {
        SdkLanguage sdkLanguage  = sdkLanguages.get(i);
           Image image = new Image(Utils.getSdkLanguageIcon(sdkLanguage));
           image.setTitle(Utils.getSdkLanguageText(sdkLanguage));
           image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
           Label label = new Label(Utils.getSdkLanguageText(sdkLanguage));
           sdkLanguagesPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
           sdkLanguagesPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
           sdkLanguagesPanel.add(image);
           sdkLanguagesPanel.setCellWidth(image, "32px");
           sdkLanguagesPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
           sdkLanguagesPanel.add(label);
           if (i < sdkLanguages.size()-1) {
               label.getElement().getStyle().setPaddingRight(10, Unit.PX);
           }
           label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
       }
}
项目:sandbox-frame    文件:ProjectBundleViewImpl.java   
@Override
public void setPlatforms(List<Platform> platforms) {
    for (int i=0;i<platforms.size();i++) {
        Platform platform  = platforms.get(i);
        Image image = new Image(Utils.getPlatformIcon(platform));
        image.setTitle(Utils.getPlatformText(platform));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getPlatformText(platform));
        platformsPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        platformsPanel.add(image);
        platformsPanel.setCellWidth(image, "32px");
        platformsPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        platformsPanel.add(label);
        if (i < platforms.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);
    }
}
项目:sandbox-frame    文件:ProjectBundleViewImpl.java   
@Override
public void setFeatures(List<Feature> features) {
    for (int i=0;i<features.size();i++) {
        Feature feature = features.get(i);
        Image image = new Image(Utils.getFeatureIcon(feature));
        image.setTitle(Utils.getFeatureText(feature));
        image.getElement().getStyle().setVerticalAlign(VerticalAlign.MIDDLE);
        Label label = new Label(Utils.getFeatureText(feature));
        featuresPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        featuresPanel.add(image);
        featuresPanel.setCellWidth(image, "32px");
        featuresPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
        featuresPanel.add(label);
        if (i < features.size()-1) {
            label.getElement().getStyle().setPaddingRight(10, Unit.PX);
        }
        label.getElement().getStyle().setPaddingLeft(8, Unit.PX);

    }
}
项目:unitimes    文件:ClassificationsEdit.java   
public MyCell(CurriculumInterface curriculum, CurriculumClassificationInterface classification) {
    iCurriculum = curriculum;
    iClasf = classification;

    iPanel = new HorizontalPanel();

    iTextBox = new UniTimeTextBox(6, ValueBoxBase.TextAlignment.RIGHT);
    iTextBox.addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            try {
                if (iTextBox.getText().isEmpty()) {
                    iClasf.setExpected(null);
                } else {
                    iClasf.setExpected(Integer.valueOf(iTextBox.getText()));
                }
            } catch (Exception e) {
                iClasf.setExpected(null);
            }
            update();
            for (MySumCell sum: iSums)
                sum.update();
        }
    });

    iRearLabel = new HTML("", false);
    iRearLabel.setWidth("50px");
    iRearLabel.setStyleName("unitime-Label");
    iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    iPanel.add(iTextBox);
    iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);

    iPanel.add(iRearLabel);
    iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);

    initWidget(iPanel); 

    update();
}
项目:unitimes    文件:ClassificationsEdit.java   
public MySumCell(List<MyCell> cells) {
    iCells = cells;
    for (MyCell cell: iCells)
        cell.iSums.add(this);

    iPanel = new HorizontalPanel();

    iTextBox = new HTML("", false);
    iTextBox.setWidth("60px");
    iTextBox.setStyleName("unitime-Label");
    iTextBox.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    iRearLabel = new HTML("", false);
    iRearLabel.setWidth("55px");
    iRearLabel.setStyleName("unitime-Label");
    iRearLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    iPanel.add(iTextBox);
    iPanel.setCellVerticalAlignment(iTextBox, HasVerticalAlignment.ALIGN_MIDDLE);

    iPanel.add(iRearLabel);
    iPanel.setCellVerticalAlignment(iRearLabel, HasVerticalAlignment.ALIGN_MIDDLE);

    initWidget(iPanel); 

    update();
}
项目:unitimes    文件:RoomNoteChanges.java   
private void populate(GwtRpcResponseList<ChangeLogInterface> logs) {
    List<UniTimeTableHeader> header = new ArrayList<UniTimeTableHeader>();

    header.add(new UniTimeTableHeader(MESSAGES.colDate(), clickHandler(0)));
    header.add(new UniTimeTableHeader(MESSAGES.colAcademicSession(), clickHandler(1)));
    header.add(new UniTimeTableHeader(MESSAGES.colManager(), clickHandler(2)));
    header.add(new UniTimeTableHeader(MESSAGES.colNote(), clickHandler(3)));
    iChanges.addRow(null, header);

    for (ChangeLogInterface log: logs) {
        List<Widget> line = new ArrayList<Widget>();

        line.add(new Label(sDateFormat.format(log.getDate()), false));
        line.add(new Label(log.getSession(), false));
        line.add(new HTML(log.getManager() == null ? "<i>" + MESSAGES.notApplicable() + "</i>" : log.getManager(), false));
        HTML note = new HTML(log.getObject() == null || log.getObject().isEmpty() || "-".equals(log.getObject()) ? "<i>" + MESSAGES.emptyNote() + "</i>" : log.getObject());
        note.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP);
        line.add(note);

        iChanges.addRow(log, line);
        iChanges.getRowFormatter().setVerticalAlign(iChanges.getRowCount() - 1, HasVerticalAlignment.ALIGN_TOP);
    }

    if (LastChangesCookie.getInstance().getSortColumn() >= 0) {
        iChanges.sort((UniTimeTableHeader)null, comparator(LastChangesCookie.getInstance().getSortColumn(), LastChangesCookie.getInstance().getSortOrder()));
        header.get(LastChangesCookie.getInstance().getSortColumn()).setOrder(LastChangesCookie.getInstance().getSortOrder());
    }

    iChanges.setColumnVisible(1, iMultiSessionToggle.getValue());
}
项目:unitimes    文件:WebTable.java   
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
    super(null, separator);
    if (names != null && !names.isEmpty()) {
        separator = separator.replace(" ", "&nbsp;");
        for (int i = 0; i < names.size(); i++) {
            String text = names.get(i) + (i + 1 < names.size() ? separator : "");
            String email = (emails != null && i < emails.size() ? emails.get(i) : null);
            if (email != null && !email.isEmpty()) {
                iText += text;
                HorizontalPanel p = new HorizontalPanel();
                p.setStyleName("instructor");
                Anchor a = new Anchor();
                a.setHref("mailto:" + email);
                a.setHTML(new Image(RESOURCES.email()).getElement().getString());
                a.setTitle(MESSAGES.sendEmail(names.get(i)));
                a.setStyleName("unitime-SimpleLink");
                a.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent event) {
                        event.stopPropagation();
                    }
                });
                p.add(a);
                p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
                HTML h = new HTML(text, false);
                h.getElement().getStyle().setMarginLeft(2, Unit.PX);
                p.add(h);
                iPanel.add(p);
                iContent.add(h);
            } else
                add(text);
        }
    } else {
        add("&nbsp;");
    }
}