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

The following are Jave code examples for showing how to use addStyleName() of the com.google.gwt.user.client.ui.VerticalPanel 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: LayerManagerWidget.java   Source Code and License Vote up 6 votes
private VerticalPanel getFoot() {
	slider.setWidth("290px");
	slider.disable();
	slider.setIncrement(1);

	slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {

		@Override
		public void onValueChange(final ValueChangeEvent<Integer> event) {
			final Layer layer = getSelectedLayer(getSelectedTabName());
			layer.setOpacity((float) (event.getValue().intValue() / 100.0));
		}

	});

	final VerticalPanel panel = new VerticalPanel();
	panel.setWidth("300px");
	panel.addStyleName(ThemeStyles.get().style().borderTop());
	panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
	panel.add(slider);

	panel.add(statusBar);
	return panel;
}
 
Example 2
Project: x-cure-chat   File: ForumTopicMessageUI.java   Source Code and License Vote up 6 votes
@Override
public UserAvatarWidget populateAvatarTitlePanel(VerticalPanel avatarVerticalPanel, final ShortUserData senderData) {
	//Add the title label
	final Label createdByLabel = new Label( i18nTitles.topicCreatedByFieldTitle() );
	createdByLabel.setStylePrimaryName( CommonResourcesContainer.USER_DIALOG_COMPULSORY_FIELD_STYLE );
	createdByLabel.setWordWrap( false );
	avatarVerticalPanel.add( createdByLabel );
	avatarVerticalPanel.addStyleName( CommonResourcesContainer.FORUM_TITLE_EXTRA_STYLE );
	
	//Add the avatar in a mode without the image
	final UserAvatarWidget avatarWidget = new UserAvatarWidget( senderData, UserAvatarWidget.DISPLAY_USER_NAME_DATA );
	avatarVerticalPanel.add( avatarWidget );
	
	//Return the avatar object
	return avatarWidget;
}
 
Example 3
Project: x-cure-chat   File: ChatMessagesPanelUI.java   Source Code and License Vote up 6 votes
/**
 * 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 );
}
 
Example 4
Project: ontobrowser   File: ErrorView.java   Source Code and License Vote up 6 votes
public ErrorView() {
	VerticalPanel panel = new VerticalPanel();
	Button reloadButton = new Button("Restart");
			
	dialogBox.setText("System Error");
	dialogBox.setGlassEnabled(true);
	dialogBox.setAnimationEnabled(true);
	dialogBox.addStyleName("gwt-ErrorDialogBox");
	
	panel.addStyleName("dialog-vpanel");
	panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	errorLabel.addStyleName("dialog-error-icon");
	panel.add(errorLabel);
	
	reloadButton.addClickHandler(this);
	panel.add(reloadButton);
	
	dialogBox.setWidget(panel);
}
 
Example 5
Project: sandbox-frame   File: BaseViewImpl.java   Source Code and License Vote up 6 votes
public BaseViewImpl(boolean useDetailsPanel) {
    errorPanel = new AlertPanel(Type.ERROR);
    sandboxStyle = Utils.sandboxStyle;
    avroUiStyle = Utils.avroUiStyle;
    initWidget(createAndBindUi());
    setTitle(getViewTitle());
    if (useDetailsPanel) {
        detailsPanel = new VerticalPanel();
        detailsPanel.setWidth("100%");
        detailsPanel.addStyleName(sandboxStyle.contentPanel());
        ScrollPanel scroll = new ScrollPanel();
        scroll.setWidth("100%");
        scroll.add(detailsPanel);
        centerPanel.setWidget(scroll);
    }
    initCenterPanel();        
    clearError();
}
 
Example 6
Project: google-gin   File: DefaultHomepage.java   Source Code and License Vote up 6 votes
@Inject
public DefaultHomepage(CardGrid cardGrid,
                @StartGame Button button,
                GameHost startGame,
                ScoreBoard scoreBoard) {
  
  button.addClickListener(startGame);

  VerticalPanel gamePanel = new VerticalPanel();
  gamePanel.addStyleName("widePanel");

  Label title = new Label("Welcome to... Higher or Lower!");
  title.addStyleName("title");
  gamePanel.add(title);

  gamePanel.add(button);
  gamePanel.add(cardGrid);
  gamePanel.add(scoreBoard);
  initWidget(gamePanel);
}
 
Example 7
Project: geowe-core   File: LayerManagerWidget.java   Source Code and License Vote up 6 votes
private VerticalPanel getFoot() {
	slider.setWidth("290px");
	slider.disable();
	slider.setIncrement(1);

	slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {

		@Override
		public void onValueChange(final ValueChangeEvent<Integer> event) {
			final Layer layer = getSelectedLayer(getSelectedTabName());
			layer.setOpacity((float) (event.getValue().intValue() / 100.0));
		}

	});

	final VerticalPanel panel = new VerticalPanel();
	panel.setWidth("300px");
	panel.addStyleName(ThemeStyles.get().style().borderTop());
	panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
	panel.add(slider);

	panel.add(statusBar);
	return panel;
}
 
Example 8
Project: firefly   File: Form.java   Source Code and License Vote up 6 votes
public Form(boolean addComponentBackground) {

        form.addStyleName("input-form-layout");
        //form.addStyleName("standard-border");
        if (addComponentBackground) form.addStyleName("component-background");
        buttonBar = new ButtonBar();
        buttonBar.setVisible(false);
        buttonBar.addStyleName("button-bar");
        //buttonBar.addStyleName("standard-border");

        VerticalPanel mainLayoutPanel = new VerticalPanel();
        mainLayoutPanel.setSpacing(3);
        mainLayoutPanel.addStyleName("input-form");

        mainLayoutPanel.add(form);
        mainLayoutPanel.add(buttonBar);

        //initWidget(GwtUtil.centerAlign(mainLayoutPanel));
        initWidget(mainLayoutPanel);
    }
 
Example 9
Project: x-cure-chat   File: ViewMessageDialogUI.java   Source Code and License Vote up 5 votes
@Override
protected void populateDialog() {
	//ADD THE MAIN DATA FIELDS
	if( isTopicView ) {
		addNewGrid( 2, 2, false, "", true);
	} else {
		addNewGrid( 1, 1, false, "", true);
	}
	
	//Make a wrapper scroll panel around the message because it can be too long
	VerticalPanel centeringPanel = new VerticalPanel();
	centeringPanel.addStyleName( CommonResourcesContainer.MAXIMUM_WIDTH_FOR_MESSAGE_VIEW_STYLE );
	centeringPanel.setHeight("100%");
	centeringPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	centeringPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	centeringPanel.add( forumMessageUI );
	
	ScrollPanel wrapperPanel = new ScrollPanel();
	wrapperPanel.setStyleName( CommonResourcesContainer.SCROLLABLE_SIMPLE_PANEL );
	//Force the maximum viewable area for the displayed forum message
	wrapperPanel.addStyleName( CommonResourcesContainer.MAXIMUM_SIZE_FOR_MESSAGE_VIEW_STYLE );
	wrapperPanel.add( centeringPanel );
	
	if( isTopicView ) {
		addToGrid( this.getCurrentGridIndex(), FIRST_COLUMN_INDEX, 2, wrapperPanel, false, false );
		
		//Add the grid action buttons
		this.addGridActionElements(true, true);
	} else {
		addToGrid( FIRST_COLUMN_INDEX, wrapperPanel, false, false );
	}
}
 
Example 10
Project: ontobrowser   File: ControlledVocabularyTermLinksView.java   Source Code and License Vote up 5 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();					
	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true) {
		@Override
		public void setPageStart(int index) {
			HasRows display = getDisplay();
			if (display != null) {
				Range range = display.getVisibleRange();
				int pageSize = range.getLength();
				if (isRangeLimited() && display.isRowCountExact()) {
					index = Math.min(index, display.getRowCount() - 1);
				}
				index = Math.max(0, index);
				if (index != range.getStart()) {
					display.setVisibleRange(index, pageSize);
				}
			}
		}
	};
			
	vertPanel.addStyleName("dialog-vpanel");
					
	
	vertPanel.add(table);
	vertPanel.add(pager);
    
	pager.setDisplay(table);
	pager.addStyleName("centered-hortz");    
    				
	dialogBox.setWidget(vertPanel);
}
 
Example 11
Project: optaplanner-wb   File: MultiConstraintHardMediumSoftMatchRuleModellerWidget.java   Source Code and License Vote up 5 votes
public MultiConstraintHardMediumSoftMatchRuleModellerWidget(final RuleModeller mod,
                                                            final EventBus eventBus,
                                                            final ActionMultiConstraintHardMediumSoftMatch actionConstraintMatch,
                                                            final TranslationService translationService,
                                                            final Boolean readOnly) {
    super(mod,
          eventBus,
          translationService);

    hardConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionHardConstraintMatch());
    hardConstraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionHardConstraintMatch()));
    mediumConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionMediumConstraintMatch());
    mediumConstraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionMediumConstraintMatch()));
    softConstraintMatchInputWidget = new ConstraintMatchInputWidget(actionConstraintMatch.getActionSoftConstraintMatch());
    softConstraintMatchInputWidget
            .addConstraintMatchValueChangeHandler(new ConstraintMatchValueChangeHandler(actionConstraintMatch.getActionSoftConstraintMatch()));

    VerticalPanel verticalPanel = new VerticalPanel();

    HorizontalPanel labelPanel = createLabelPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_MultiConstraintMatch));
    verticalPanel.add(labelPanel);

    verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_HardScore),
                                   hardConstraintMatchInputWidget));
    verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_MediumScore),
                                   mediumConstraintMatchInputWidget));
    verticalPanel.add(getItemPanel(translationService.getTranslation(GuidedRuleEditorConstants.RuleModellerActionPlugin_SoftScore),
                                   softConstraintMatchInputWidget));

    verticalPanel.addStyleName(GuidedRuleEditorResources.INSTANCE.css().multiConstraintMatch());

    initWidget(verticalPanel);
}
 
Example 12
Project: firefly   File: BasicImageGrid.java   Source Code and License Vote up 5 votes
public void resize() {
    int px = getResizedWidth();
    for (Widget w : widgets) {
        if (!(w instanceof HTML)) {
            VerticalPanel vp = ((VerticalPanel) w);
            GwtUtil.setStyle(vp, "maxWidth", Integer.toString(px) + "px");
            GwtUtil.setStyle(vp, "width", Integer.toString(px) + "px");
            GwtUtil.setStyle(vp, "clear", "none");

            for (Iterator<Widget> i = vp.iterator(); i.hasNext(); ) {
                Widget c = i.next();
                try {
                    if (panelMap.containsKey(vp)) {
                        int height = panelMap.get(vp).getCurrentPlot().getScreenHeight() + MPW_HEADER_HEIGHT;
                        int width = px - 8;
                        vp.clear();
                        vp.add(panelMap.get(vp).makeFixedSizeContainer(width, height, false));
                        vp.addStyleName("shadow");
                        GwtUtil.setStyles(vp, "margin", "2px",
                                "background","#E5E5E5 url(images/bg_boxgradient.png) repeat-x");
                    } else {
                        GwtUtil.setStyle(c, "maxWidth", Integer.toString(px) + "px");
                        GwtUtil.setStyle(c, "width", Integer.toString(px) + "px");
                    }
                } catch (NullPointerException e) {
                    //todo: handle null pointer exception
                }
            }
        }
    }
}
 
Example 13
Project: firefly   File: PopupPane.java   Source Code and License Vote up 5 votes
protected Widget makeSideHeader() {

        Widget close = makeCloseButton(false);

        SimplePanel panel= new SimplePanel();
        panel.addStyleName(_ffCss.titleBgColor());
        panel.addStyleName(_ffCss.titleColor());
        panel.setHeight("100%");


        VerticalPanel header = new VerticalPanel();
        titleLabel.addStyleName("title-label");
        titleLabel.setHeight("100%");
        DOM.setStyleAttribute(titleLabel.getElement(), "cursor", "default");

        GwtUtil.setStyle(header, "paddingTop", "3px");

        titleLabel.setHTML("&nbsp;");

        header.addStyleName(_ffCss.popupTitleVerticalBackground());
        header.addStyleName(_ffCss.titleBgColor());
        header.addStyleName(_ffCss.titleColor());
//        header.addStyleName(_ffCss.popupBackground());

        header.add(close);
        header.add(titleLabel);
        header.setCellHeight(titleLabel, "100%");
        header.setWidth("15px");
        header.setHeight("100%");

        panel.setWidget(header);
        return panel;
    }
 
Example 14
Project: firefly   File: SearchPanel.java   Source Code and License Vote up 5 votes
private SearchPanel() {

        navPanel = new VerticalPanel();

        formPanel.addStyleName("content-panel");
        setFormAreaMinWidth("500px");

        //li
        DockPanel mainPanel = new DockPanel();
        mainPanel.addStyleName("component-background");
        mainPanel.add(navPanel, DockPanel.WEST);
        mainPanel.add(formPanel, DockPanel.CENTER);

        Element el = (Element) navPanel.getElement().getParentElement();
        if (el != null) {
            DOM.setStyleAttribute(el, "background", "#E5E5E5");
            DOM.setStyleAttribute(el, "padding", "10px 10px 10px 30px");
            DOM.setStyleAttribute(el, "borderRight", "2px outset #e8e8e8");
        } else {
            navPanel.addStyleName("search-panel-list");
        }

//        mainPanel.setWidth("100%");
        mainPanel.setCellWidth(navPanel, "200px");
        mainPanel.setCellHeight(navPanel, "100%");

        initWidget(mainPanel);
    }
 
Example 15
Project: EasyML   File: HistoryPopupPanel.java   Source Code and License Vote up 4 votes
/**
 * UI Initialization
 */
protected void init() {
	this.setSize("850px", "400px");
	this.setGlassEnabled(true);
	this.setModal(true);

	desc.setText(desc.getText()+"  Job Id - "+bdaJobId);
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");

	VerticalPanel topPanel = new VerticalPanel(); //Outermost vertical panel
	topPanel.add(closeButton);
	topPanel.setCellHeight(closeButton, "13px");
	topPanel.setStyleName("vpanel");
	desc.setStyleName("popupTitle");
	topPanel.add(desc);
	topPanel.setCellHeight(desc, "30px");

	HorizontalPanel optPanel = new HorizontalPanel(); //Operation panel(include search, batch delete.etc)
	optPanel.addStyleName("run-history-optPanel");
	DateTimeFormat pickerFormat = DateTimeFormat.getFormat("yyyy-MM-dd");
	startTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
	startTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
	endTimeBox.setFormat(new DateBox.DefaultFormat(pickerFormat));
	endTimeBox.getDatePicker().addStyleName("run-history-datepicker-popup");
	searchBtn.removeStyleName("gwt-Button");
	searchBtn.addStyleName("run-history-search-button");
	//The initial time is set to 2016-1-1
	endTime = new Date();
	DateTimeFormat tmpFormatter = DateTimeFormat.getFormat("yyyy-MM-dd");
	startTime = tmpFormatter.parse("2016-01-01");
	selectAllChkBox.setVisible(false);
	batchDelBtn.removeStyleName("gwt-Button");
	batchDelBtn.addStyleName("run-history-batch-del-button");

	optPanel.add(startTimeLabel); 
	optPanel.add(startTimeBox);
	optPanel.add(endTimeLabel);
	optPanel.add(endTimeBox);
	optPanel.add(searchBtn);
	if(isExample && !AppController.power.equals("111"))  //Example job only can be deleted by administrator privileges
	{}
	else
		optPanel.add(batchDelBtn);
	optPanel.add(selectAllChkBox);

	runHistoryGrid.addStyleName("run-history-table"); //Data view
	runHistoryGrid.addStyleName("table-striped");
	runHistoryGrid.addStyleName("table-hover");
	runHistoryGrid.resize(rowNum, colNum);
	for(int i=0;i<colNum;i++)
	{
		runHistoryGrid.setText(0, i, columns[i]);
	}
	initGridData();

	topPanel.add(optPanel);
	topPanel.add(runHistoryGrid);

	VerticalPanel bottomPanel = new VerticalPanel(); //Paging control
	bottomPanel.add(pageGrid);
	bottomPanel.addStyleName("run-history-bottomPanel");

	VerticalPanel panel = new VerticalPanel();
	panel.add(topPanel);
	panel.add(bottomPanel);

	this.add(panel);
	this.setStyleName("loading_container");
}
 
Example 16
Project: x-cure-chat   File: ForumMessageWidget.java   Source Code and License Vote up 4 votes
private void populateTitlePanel() {
	//Add the avatar panel to the message if needed
	final boolean isAvatarPanelNeeded = isAvatarTitlePanelNeeded();
	if( isAvatarPanelNeeded ) {
		//Add the sub-panel with the avatar
		VerticalPanel avatarTitlePanel = new VerticalPanel();
		avatarTitlePanel.setWidth("100%");
		avatarTitlePanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
		avatarTitlePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
		avatarTitlePanel.addStyleName( CommonResourcesContainer.MESSAGE_AVATAR_TITLE_PANEL_STYLE );
		
		//Populate the panel, store the link to the avatar, if needed
		userAvatar = populateAvatarTitlePanel( avatarTitlePanel, messageData.senderData );
		
		//Put it into the message
		titlePanelTable.setWidget(0, 0, avatarTitlePanel );
		titlePanelTable.getCellFormatter().addStyleName(0, 0, CommonResourcesContainer.FORUM_MESSAGE_SUBJECT_DELIM_PANEL_STYLE );
	}
	
	//Add the subpanel with the title and other message info
	VerticalPanel titleVertPanel = new VerticalPanel();
	titleVertPanel.setHeight("100%");
	//In case of the avatar panel NOT needed this is the first cell in the row, otherwise it is the second cell
	titlePanelTable.setWidget(0, ( isAvatarPanelNeeded ? 1 : 0 ), titleVertPanel );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	titleVertPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	
	final Label messageSubjectField = new Label( getMessageSubjectFieldName() + ":" );
	messageSubjectField.setWordWrap( false );
	MessageTextToFlowPanel.addContentWidget( messageSubjectContent, messageSubjectField, true );
	final List<Widget> messageWidgets = SmileyHandlerUI.getMessageViewObject( messageData.messageTitle,
																			  ChatMessage.MAX_ONE_WORD_LENGTH, false );
	for( Widget w : messageWidgets ) {
		MessageTextToFlowPanel.addContentWidget( messageSubjectContent, w, true );
	}
	
	//Set the proper styles to the field and value labels
	setMessageSubjectFieldValueStyles( messageSubjectField, messageSubjectContent );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_TOP );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	//Add message title clicking capability, if needed
	if( isMsgTitleClickable ) {
		//THe clickable version allows to view the forum message replies
		messageSubjectClickPanel = new FocusPanel();
		messageSubjectClickPanel.setTitle( getViewForumMessageRepliesLinkText() );
		messageSubjectClickPanel.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
		messageSubjectClickPanel.add( messageSubjectContent );
		titleVertPanel.add( messageSubjectClickPanel );
	} else {
		messageSubjectContent.addStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_STYLE );
		titleVertPanel.add( messageSubjectContent );
	}
	
	lastSenderProfileLink = populateMessageTitleLastReplyInfoPanel( titleInfoLastRepPanel );
	titleVertPanel.add( titleInfoLastRepPanel );
	
	//Add the message title info
	if( SiteManager.isAdministrator() ) {
		//if the user is an administrator, then he is allowed to see the message id of all messages
		addNewFieldValuePair( titleInfoPanel, i18nTitles.forumMessageID(), messageData.messageID + "", true );
	}
	populateMessageTitleInfoPanel( titleInfoPanel );
	titleVertPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	titleVertPanel.add( titleInfoPanel );
	
	//Complete the title panel
	mainVerticalPanel.add( titlePanelTable );

	//Add the delimiter panel
	SimplePanel delimiterPanel = new SimplePanel();
	delimiterPanel.setStyleName( CommonResourcesContainer.FORUM_MESSAGE_TITLE_DELIMITER_PANEL_STYLE );
	mainVerticalPanel.add( delimiterPanel );
}
 
Example 17
Project: ontobrowser   File: HistoryPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();					
	HorizontalPanel filterPanel = new HorizontalPanel();
	Label filterLabel = new Label("Keyword Filter:");
	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true) {
		@Override
		public void setPageStart(int index) {
			HasRows display = getDisplay();
			if (display != null) {
				Range range = display.getVisibleRange();
				int pageSize = range.getLength();
				if (isRangeLimited() && display.isRowCountExact()) {
					index = Math.min(index, display.getRowCount() - 1);
				}
				index = Math.max(0, index);
				if (index != range.getStart()) {
					display.setVisibleRange(index, pageSize);
				}
			}
		}
	};
	Button closeButton = new Button("Close");
	closeButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
		}
	});
	
	filterLabel.addStyleName("dialog-label");
	
	filterPanel.addStyleName("dialog-hpanel");
	filterPanel.add(filterLabel);
	filterPanel.add(filterTextBox);
	filterPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
					
	pager.addStyleName("centered-hortz");				    
	pager.setDisplay(table);
	
	vertPanel.addStyleName("dialog-vpanel");
	vertPanel.add(filterPanel);
	vertPanel.add(table);
	vertPanel.add(pager);
    vertPanel.add(closeButton);
    vertPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER);
	dialogBox.setWidget(vertPanel);
}
 
Example 18
Project: ontobrowser   File: AddRelationshipPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
	DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
	Button cancelButton = new Button("Cancel");
	
	recentlyViewedPanel.getHeader().addStyleName("dialog-label");
	recentlyViewedPanel.add(recentlyViewTable);
	
	recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
	recentlyCreatedPanel.add(recentlyCreatedTable);
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			if(currentTerm != null) {
				eventBus.fireEvent(new ViewTermEvent(currentTerm));
			}
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeDropBox);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}
			
	buttonsHPanel.add(addButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(recentlyViewedPanel);
	vertPanel.add(recentlyCreatedPanel);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
Example 19
Project: ontobrowser   File: ReplaceRelationshipPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
	Grid grid = new Grid(4,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label commentsLabel = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");
	replacementLabel.addStyleName("dialog-label");
	commentsLabel.addStyleName("dialog-label");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			relationship = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Relationship:"));
	grid.setWidget(++row, col, new Label("Related Term:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, typeLabel);
	grid.setWidget(++row, col, relatedTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(replacementLabel);
	vertPanel.add(table);
	vertPanel.add(commentsLabel);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
Example 20
Project: ontobrowser   File: ReplaceTermPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	Grid grid = new Grid(3,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	DisclosurePanel recentlyViewedPanel = new DisclosurePanel("Recently Viewed Terms");
	DisclosurePanel recentlyCreatedPanel = new DisclosurePanel("Recently Created Terms");
	Label comments = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	comments.addStyleName("dialog-label");
	
	recentlyViewedPanel.getHeader().addStyleName("dialog-label");
	recentlyViewedPanel.add(recentlyViewTable);
	
	recentlyCreatedPanel.getHeader().addStyleName("dialog-label");
	recentlyCreatedPanel.add(recentlyCreatedTable);
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			obsoleteTerm = null;
			commentsField.setValue(null);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, new Label("Ontology:"));
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Replaced By:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, replaceByTermLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	vertPanel.add(grid);
	vertPanel.add(recentlyViewedPanel);
	vertPanel.add(recentlyCreatedPanel);
	vertPanel.add(comments);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	dialogBox.setWidget(vertPanel);
}
 
Example 21
Project: ontobrowser   File: ReplaceSynonymPopup.java   Source Code and License Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel vertPanel = new VerticalPanel();
	SimplePanel decPanel = new SimplePanel();
   	Grid grid = new Grid(5,2);
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	
	Label comments = new Label("Comments:");
	Button cancelButton = new Button("Cancel");
	
	decPanel.addStyleName("decorator-panel");		
	comments.addStyleName("dialog-label");
							
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
			synonym = null;
			commentsField.setValue(null);
			errorLabel.setVisible(false);
		}
	});
	
	grid.addStyleName("gwt-Grid");
	errorLabel.addStyleName("dialog-error");
	buttonsHPanel.addStyleName("dialog-buttons");
	buttonsHPanel.addStyleName("centered-hortz");
	vertPanel.addStyleName("dialog-vpanel");		
	//vertPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
			
	int row = 0, col = 0;
	grid.setWidget(row, col, ontologyHeadingLabel);
	grid.setWidget(++row, col, new Label("Term:"));
	grid.setWidget(++row, col, new Label("Synonym:"));
	grid.setWidget(++row, col, new Label("Source:"));
	grid.setWidget(++row, col, new Label("Reference Id:"));
	row = 0;
	col = 1;
	grid.setWidget(row, col, ontologyLabel);
	grid.setWidget(++row, col, termLabel);
	grid.setWidget(++row, col, synonymLabel);
	grid.setWidget(++row, col, sourceLabel);
	grid.setWidget(++row, col, referenceIdLabel);
	
	for(row = col = 0; row < grid.getRowCount(); row++) {
		Label label = (Label)grid.getWidget(row, col);
		label.addStyleName("dialog-label");
	}			
							
	buttonsHPanel.add(obsoleteButton);
	buttonsHPanel.add(cancelButton);
	
	decPanel.setWidget(grid);
	//vertPanel.add(grid);
	vertPanel.add(decPanel);
	vertPanel.add(comments);
	vertPanel.add(commentsField);
	vertPanel.add(errorLabel);
	vertPanel.add(buttonsHPanel);
	
	dialogBox.setWidget(vertPanel);
}
 
Example 22
Project: OpenTripPlanner-client-gwt   File: AlertWidget.java   Source Code and License Vote up 4 votes
public AlertWidget(AlertBean alert) {
	VerticalPanel rootPanel = new VerticalPanel();

	FocusPanel headerPanel = new FocusPanel();
	rootPanel.add(headerPanel);
	headerPanel.addStyleName("alert-header");
	HorizontalPanel titleAndButtonPanel = new HorizontalPanel();
	headerPanel.add(titleAndButtonPanel);
	Label icon = new Label("");
	icon.addStyleName(alert.getLevel() == AlertBean.LEVEL_INFO ? "info-icon"
			: "warn-icon");
	titleAndButtonPanel.add(icon);
	Label alertTitle = new Label(alert.getTitle());
	alertTitle.addStyleName("alert-title");
	titleAndButtonPanel.add(alertTitle);

	final SimplePanel collapsibleOuterPanel = new SimplePanel();
	rootPanel.add(collapsibleOuterPanel);
	collapsibleOuterPanel.addStyleName("alert-details-outer");
	VerticalPanel collapsibleInnerPanel = new VerticalPanel();
	collapsibleOuterPanel.add(collapsibleInnerPanel);
	collapsibleInnerPanel.addStyleName("alert-details-inner");
	if (DISPLAY_ALERT_DATE && alert.isPublishActiveRange()
			&& (alert.getFrom() != null || alert.getTo() != null)) {
		Label dateRangeLabel = new Label(
				formatDateRange(alert.getFrom(), alert.getTo()));
		collapsibleInnerPanel.add(dateRangeLabel);
		dateRangeLabel.addStyleName("alert-datetime");
	}
	Label descriptionLabel = new Label(alert.getDescription());
	collapsibleInnerPanel.add(descriptionLabel);
	descriptionLabel.addStyleName("alert-description");
	if (alert.getUrl() != null && alert.getUrl().length() > 0) {
		final String url = alert.getUrl();
		Anchor moreInfoAnchor = new Anchor(I18nUtils.tr("more.info.alert"));
		moreInfoAnchor.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				Window.open(url, "_blank", "");
			}
		});
		moreInfoAnchor.addStyleName("alert-url");
		collapsibleInnerPanel.add(moreInfoAnchor);
	}
	initWidget(rootPanel);
}