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

The following are Jave code examples for showing how to use setHorizontalAlignment() 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.
+ Save this method
Example 1
Project: sig-seguimiento-vehiculos   File: StatusPanelWidget.java   View Source Code Vote up 6 votes
private void initializeStatusPanel() {
	String comboWidth = "125px";
	statusPanel = new VerticalPanel();
	StyleInjector.inject(".statusPanelStyle { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	statusPanel.setStyleName("statusPanelStyle");

	statusPanel.setSpacing(5);
	statusPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

	initializeLayerCombo(comboWidth);
	initializeEpsgCombo(comboWidth);
	initializeStatusGrid();

	statusPanel.add(new FieldLabel(layerCombo, UIMessages.INSTANCE
			.sbSelectLayerLabel()));
	statusPanel.add(new FieldLabel(epsgCombo, UIMessages.INSTANCE
			.sbEpsgLabel()));
	statusPanel.add(statusGrid);

	statusPanel.setVisible(false);
}
 
Example 2
Project: appinventor-extensions   File: SimpleNonVisibleComponentsPanel.java   View Source Code Vote up 6 votes
/**
 * Creates new component design panel for non-visible components.
 */
public SimpleNonVisibleComponentsPanel() {
  // Initialize UI
  VerticalPanel panel = new VerticalPanel();
  panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

  heading = new Label("");
  heading.setStyleName("ya-NonVisibleComponentsHeader");
  panel.add(heading);

  componentsPanel = new FlowPanel();
  componentsPanel.setStyleName("ode-SimpleUiDesignerNonVisibleComponents");
  panel.add(componentsPanel);

  initWidget(panel);
}
 
Example 3
Project: mvp4g-examples   File: CompanyListView.java   View Source Code Vote up 6 votes
public void createView() {
	table = new VerticalPanel();
	createButton = new Hyperlink( "Create Company", "" );
	goToProduct = new Hyperlink( "Go To Products", "" );
	filter = new CheckBox( "Filter Company EventBus events" );
	moduleHistory = new CheckBox( "Disable Company Module History" );
	applicationHistory = new CheckBox( "Disable Application History" );

	VerticalPanel mainPanel = new VerticalPanel();
	mainPanel.add( table );
	mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
	mainPanel.add( createButton );
	mainPanel.add( goToProduct );
	mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	mainPanel.add( moduleHistory );
	mainPanel.add( applicationHistory );
	mainPanel.add( filter );

	initWidget( mainPanel );
}
 
Example 4
Project: ontobrowser   File: EditSynonymPopup.java   View Source Code Vote up 6 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			typeError.setText(null);
			dialogBox.hide();
		}
	});
	
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
	
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(grid);		
	dialogVPanel.add(typeError);
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
			
	dialogBox.setWidget(dialogVPanel);
}
 
Example 5
Project: mvp4g-examples   File: ProductListView.java   View Source Code Vote up 6 votes
public void createView() {
	table = new FlexTable();
	createButton = new Image( "images/add.png" );
	companyButton = new Anchor( "Go to company" );
	infoButton = new Anchor( "Info" );
	passiveInfoButton = new Anchor( "Passive Info" );

	VerticalPanel mainPanel = new VerticalPanel();
	mainPanel.add( table );
	mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
	mainPanel.add( createButton );
	mainPanel.add( companyButton );
	mainPanel.add( infoButton );
	mainPanel.add( passiveInfoButton );

	setWidget( mainPanel );
}
 
Example 6
Project: jolie   File: Echoes.java   View Source Code Vote up 6 votes
private void createLyricsDialog()
{
	lyricsDialog = new DialogBox();
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHeight( "100%" );
	vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER );
	vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE );
	lyricsDialog.add( vPanel );
	
	lyrics = new HTML();
	ScrollPanel scrollPanel = new ScrollPanel();
	scrollPanel.setWidth( "300px" );
	scrollPanel.setHeight( "250px" );
	scrollPanel.add( lyrics );
	vPanel.add( scrollPanel );
	
	Button close = new NativeButton( "Close" );
	close.addClickListener( new ClickListener() {
		public void onClick( Widget arg0 ) {
			lyricsDialog.hide();
		}
	} );
	vPanel.add( close );
}
 
Example 7
Project: geowe-core   File: StatusPanelWidget.java   View Source Code Vote up 6 votes
private void initializeStatusPanel() {
	String comboWidth = "125px";
	statusPanel = new VerticalPanel();
	StyleInjector.inject(".statusPanelStyle { " + "background: #E0ECF8;"
			+ "border-radius: 5px 10px;" + "opacity: 0.8}");
	statusPanel.setStyleName("statusPanelStyle");

	statusPanel.setSpacing(5);
	statusPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

	initializeLayerCombo(comboWidth);
	initializeEpsgCombo(comboWidth);
	initializeStatusGrid();

	statusPanel.add(new FieldLabel(layerCombo, UIMessages.INSTANCE
			.sbSelectLayerLabel()));
	statusPanel.add(new FieldLabel(epsgCombo, UIMessages.INSTANCE
			.sbEpsgLabel()));
	statusPanel.add(statusGrid);

	statusPanel.setVisible(false);
}
 
Example 8
Project: ontobrowser   File: ErrorView.java   View Source Code 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 9
Project: easy-vote   File: ErrorPopup.java   View Source Code Vote up 6 votes
public ErrorPopup(Widget w){
	super(false, true);
	VerticalPanel response = new VerticalPanel();
	setText("Error");
	setAnimationEnabled(true);
	setWidget(response);
	response.add(w);
	w.addStyleName("errorMessage");
	response.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
	Button closeButton = new Button("Close");
	response.add(closeButton);
	closeButton.addStyleName("closeButton");
	
	closeButton.addClickHandler(new ClickHandler() {

		public void onClick(ClickEvent event) {
			hide();
		}
	});
}
 
Example 10
Project: sig-seguimiento-vehiculos   File: JoinDataDialog.java   View Source Code Vote up 5 votes
private Widget createPanel() {
	final VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_JUSTIFY);

	vPanel.add(createTabPanel());
	vPanel.add(separatorPanel);
	vPanel.add(loadFileButton);
	vPanel.add(comboPanel);
	vPanel.add(layerAttributeComboPanel);

	return vPanel;
}
 
Example 11
Project: appinventor-extensions   File: TemplateUploadWizard.java   View Source Code Vote up 5 votes
/**
 * The UI consists of a vertical panel that holds a drop-down list box,
 *   a Horizontal panel that holds the templates list (cell list) plus
 *   the selected template. This is inserted in the Wizard dialog.
 *
 * @param templates should never be null
 * @return the main panel for Wizard dialog.
 */
VerticalPanel createUI(final ArrayList<TemplateInfo> templates) {
  VerticalPanel panel = new VerticalPanel();
  panel.setStylePrimaryName("gwt-SimplePanel");
  panel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
  panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);

  templatePanel = new HorizontalPanel();
  templatePanel.add(makeTemplateSelector(templates));
  if (templates.size() > 0)
    templatePanel.add(new TemplateWidget(templates.get(0), templateHostUrl));

  templatesMenu = makeTemplatesMenu();

  HorizontalPanel hPanel = new HorizontalPanel();
  hPanel.add(templatesMenu);
  removeButton = new Button("Remove this repository", new ClickHandler() {
      @Override
      public void onClick(ClickEvent arg0) {
        removeCurrentlySelectedRepository();
      }
    });
  removeButton.setVisible(false);
  hPanel.add(removeButton);
  panel.add(hPanel);
  panel.add(templatePanel);
  return panel;
}
 
Example 12
Project: essence   File: AnalyzerAndReportUI.java   View Source Code Vote up 5 votes
public void setupAnalyzerAndReportPanel2(ScrollPanel analyzerPanel, DockLayoutPanel dPanel) {
	// Create a CellTable.
	final CellTable<AnalyzerResultDTO> table = new CellTable<AnalyzerResultDTO>();
	setupAnalyzeResultDisplayPanel(table, dataProvider);

	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 10, true);
	pager.setDisplay(table);
	dataProvider.addDataDisplay(table);

	// Set the width of each column.
	// table.setColumnWidth(nameColumn, 35.0, Unit.PCT);
	final Label errorLabelDisplay = new Label();

	VerticalPanel displayPanel = new VerticalPanel();
	displayPanel.add(pager);
	displayPanel.add(table);
	displayPanel.add(errorLabelDisplay);
	displayPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
	analyzerPanel.add(displayPanel);

	// DoS detector panel
	// Any detector error message
	VerticalPanel vPanel = new VerticalPanel();
	final Label errorLabelActivateDetector = new Label();

	HorizontalPanel detectorPanel = new HorizontalPanel();
	detectorPanel.addStyleName("essencePanel");
	detectorPanel.setSpacing(10);
	setupDetectorPanel(detectorPanel, errorLabelActivateDetector, dataProvider);
	vPanel.add(detectorPanel);	
    
	vPanel.add(errorLabelActivateDetector);
	dPanel.addNorth(vPanel, 10);
}
 
Example 13
Project: WebConsole   File: SlidingToolbar.java   View Source Code Vote up 5 votes
private SlidingToolbar(PanelSizeInfo sizeInfo) {
	HorizontalPanel container = new HorizontalPanel();
	this.initWidget(container);
	setWidth("340px");
	setStylePrimaryName("toolbar");
	setHeight("100%");
	container.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	DOM.setStyleAttribute(getElement(), "marginLeft", "-320px");
	mainPanel = new VerticalPanel();
	mainPanel.setStylePrimaryName("mainToolbarPanel");
	tab = new Label(">");
	tab.setStylePrimaryName("tabToolbarPanel");
	container.add(mainPanel);
	container.add(tab);
	
	// Configure Main Panel
	mainPanel.setHeight("80%");
	mainPanel.setWidth("320px");
	mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	Element mainElem = mainPanel.getElement();
	DOM.setStyleAttribute(mainElem, "paddingLeft", "70px");
	DOM.setStyleAttribute(mainElem, "paddingTop", "20px");
	DOM.setStyleAttribute(mainElem, "paddingRight", "20px");
	DOM.setStyleAttribute(mainElem, "paddingBottom", "20px");
	
	// Configure Tab
	tab.setWidth("20px");
	tab.setHeight("50px");
	tab.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	Element tabElem = tab.getElement();
	DOM.setStyleAttribute(tabElem, "lineHeight", "50px");
	
	// Add to Window
	RootPanel.get().add(this, 0, 0);
	
	addAnimation();
	
	createToolbarContent(sizeInfo);
}
 
Example 14
Project: geowe-core   File: JoinDataDialog.java   View Source Code Vote up 5 votes
private Widget createPanel() {
	final VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_JUSTIFY);

	vPanel.add(createTabPanel());
	vPanel.add(separatorPanel);
	vPanel.add(loadFileButton);
	vPanel.add(comboPanel);
	vPanel.add(layerAttributeComboPanel);

	return vPanel;
}
 
Example 15
Project: firefly   File: DynUtils.java   View Source Code Vote up 5 votes
static public void PopupMessage(String title, String message) {
    final DialogBox p = new DialogBox(false, false);
    //p.setStyleName(INFO_MSG_STYLE);

    if (title != null) {
        p.setTitle(title);
    }

    VerticalPanel vp = new VerticalPanel();
    vp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    vp.setSpacing(10);
    vp.add(new HTML(message));
    vp.add(new HTML(""));

    Button b = new Button("Close");
    vp.add(b);

    p.setWidget(vp);
    p.center();

    b.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            p.hide();
            p.clear();
        }

    });

    p.show();
}
 
Example 16
Project: x-cure-chat   File: UserProfileDialogUI.java   View Source Code Vote up 5 votes
private void addAvatarDataFields() {
	//ADD THE MAIN DATA FIELDS
	addNewGrid( 1, true, titlesI18N.avatarUserProfilePanel(), true);
	
	//Initialize the avatar's image actions
	VerticalPanel avatarActionPanel = new VerticalPanel();
	avatarActionPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	avatarActionPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	ActionLinkPanel chooseAvatarActionLink = new ActionLinkPanel( ServerSideAccessManager.getChooseImageURL(), "",
																  ServerSideAccessManager.getChooseImageURL(), "",
																  titlesI18N.chooseLinkTitle(), avatarChooseAction, true, true ); 
	chooseAvatarActionLink.setImportant();
	avatarActionPanel.add( chooseAvatarActionLink );
	avatarActionPanel.add( new ActionLinkPanel( ServerSideAccessManager.getUploadImageURL(), "",
												ServerSideAccessManager.getUploadImageURL(), "",
												titlesI18N.uploadLinkTitle(), avatarUploadAction, true, true ) );
	avatarActionPanel.add( new ActionLinkPanel( ServerSideAccessManager.getDeleteImageURL(), "",
												ServerSideAccessManager.getDeleteImageURL(), "",
												titlesI18N.deleteLinkTitle(), avatarDeleteAction, true, true ) );
	
	HorizontalPanel avatarPanel = new HorizontalPanel();
	avatarPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	avatarPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
	avatarPanel.add( avatarImage );
	avatarPanel.add( new HTML("&nbsp;") );
	avatarPanel.add( avatarActionPanel );
	addToGrid( FIRST_COLUMN_INDEX, avatarPanel, false, false );
}
 
Example 17
Project: x-cure-chat   File: ChooseAvatarDialogUI.java   View Source Code Vote up 5 votes
private Widget initAvatarPanel( final int index, final PresetAvatarImages.AvatarDescriptor descriptor ){
	Widget avatarWidget;
	
	//Initialize the avatar image
	final String avatarURLBase = ServerSideAccessManager.getPresetAvatarImagesBase();
	Image image = new Image( avatarURLBase + descriptor.relativeURL );
	image.setStyleName( CommonResourcesContainer.AVATAR_IMAGE_CHOICE_DEFAULT_STYLE );
	image.setTitle( titlesI18N.clickToChooseToolTip() );
	
	//Sort out what the avatar widget is.
	if( descriptor.price > 0 ) {
		//If there is a price tag then the avatar is a special object
		FocusPanel focusPanel = new FocusPanel();
		VerticalPanel verticalPanel = new VerticalPanel();
		verticalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
		verticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
		verticalPanel.add( image );
		verticalPanel.add( new PriceTagWidget( null, descriptor.price, false, true ));
		focusPanel.add( verticalPanel );
		avatarWidget = focusPanel;
	} else {
		//If there is no price then the avatar is the image widget itself
		avatarWidget = image;
	}
	
	//Add the floading style and the click handler
	avatarWidget.addStyleName( CommonResourcesContainer.AVATAR_IMAGE_IN_LIST_STYLE );
	((HasClickHandlers) avatarWidget).addClickHandler( new ClickHandler() {
		public void onClick(ClickEvent e) {
			if( isChooseEnabled ) {
				//Initiate the avatar selection, do the RPC call
				doChooseAvatarServerCall( index );
			}
			//Just in case stop the event here
			e.preventDefault(); e.stopPropagation();
		}
	});
	
	return (Widget) avatarWidget;
}
 
Example 18
Project: x-cure-chat   File: XCureChatMain.java   View Source Code Vote up 5 votes
public void initializeWarning( final String warningString ) {
   	//For the MS IE we add an error/warning message
   	//about that we do not really suport it
   	VerticalPanel warningPanel = new VerticalPanel();
   	warningPanel.setStyleName( CommonResourcesContainer.IE_ERROR_PANEL_STYLE_NAME );
   	warningPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
   	warningPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
   	//Add the error/warning message
   	HTML errorMessage = new HTML( warningString );
   	warningPanel.add( errorMessage );
  	
   	//Add the horizontal panel with the continue button and the localization list box
   	HorizontalPanel horizPanel = new HorizontalPanel();
   	horizPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
   	horizPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
   	//Add the continue button
   	Button continueButon = new Button();
   	continueButon.setText( I18NManager.getTitles().continueButtonTitle() );
   	continueButon.setStyleName( CommonResourcesContainer.USER_DIALOG_ACTION_BUTTON_STYLE );
   	continueButon.addClickHandler( new ClickHandler() {
   		public void onClick( ClickEvent e) {
   	    	//Remember that the user was warned about using MS IE
   	    	SiteManager.setMSIEWarned();
   	    	//Initialize the web site
   	    	initializeSite();
   		}
   	});
   	horizPanel.add( continueButon );
   	//Add spacing
   	horizPanel.add( new HTML("&nbsp;") );
   	//Add the localization list box
   	horizPanel.add( InterfaceUtils.getLocaleSelectionPanel() );
   	
   	warningPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_RIGHT );
   	warningPanel.add( horizPanel );
   	RootPanel.get().add( warningPanel );
}
 
Example 19
Project: essence   File: DecisionUI.java   View Source Code Vote up 4 votes
public void setupDecisionPanels(ScrollPanel decisionPanel, DockLayoutPanel dPanel) {
	// Create a CellTable.
	final CellTable<DecisionDTO> table = new CellTable<DecisionDTO>();
	setupDecisionDisplayPanel(table, dataProvider);

	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 10, true);
	pager.setDisplay(table);
	dataProvider.addDataDisplay(table);

    final SingleSelectionModel<DecisionDTO> selectionModel = new SingleSelectionModel<DecisionDTO>();
    table.setSelectionModel(selectionModel);

	// Set the width of each column.
	// table.setColumnWidth(nameColumn, 35.0, Unit.PCT);
	final Label errorLabelDisplay = new Label();

	greetingService.getDecisions(new AsyncCallbackAdapter<List<DecisionDTO>>() {
		/*
		public void onFailure(Throwable caught) {
			errorLabelDisplay.setText(SERVER_ERROR);
		}
		*/
		// Called by onFailure if the session is still valid
		public void doFailureAction() {
			errorLabelDisplay.setText(SERVER_ERROR);
		}

		public void onSuccess(List<DecisionDTO> result) {
			dataProvider.setList(result);
		}
	});

	VerticalPanel displayPanel = new VerticalPanel();
	displayPanel.add(pager);
	displayPanel.add(table);
	displayPanel.add(errorLabelDisplay);
	displayPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
	decisionPanel.add(displayPanel);

	VerticalPanel vPanel = new VerticalPanel();
	final Label errorLabelControl = new Label();
	HorizontalPanel controlPanel = new HorizontalPanel();
	controlPanel.addStyleName("essencePanel");
	controlPanel.setSpacing(10);
	setupControlPanel(controlPanel, errorLabelControl, dataProvider);
	vPanel.add(controlPanel);	
    
	vPanel.add(errorLabelControl);
	dPanel.addNorth(vPanel, 10);
}
 
Example 20
Project: essence   File: ActionUI.java   View Source Code Vote up 4 votes
public void setupActionPanels(ScrollPanel ActionPanel, DockLayoutPanel dPanel) {
	

	// Create a CellTable.
	final CellTable<ActionDTO> table = new CellTable<ActionDTO>();
	setupActionDisplayPanel(table, dataProvider);

	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 10, true);
	pager.setDisplay(table);
	dataProvider.addDataDisplay(table);

    final SingleSelectionModel<ActionDTO> selectionModel = new SingleSelectionModel<ActionDTO>();
    table.setSelectionModel(selectionModel);

	// Set the width of each column.
	// table.setColumnWidth(nameColumn, 35.0, Unit.PCT);
	final Label errorLabelDisplay = new Label();

	greetingService.getActions(new AsyncCallbackAdapter<List<ActionDTO>>() {
		/*
		public void onFailure(Throwable caught) {
			errorLabelDisplay.setText(SERVER_ERROR);
		}
		*/
		
		// Called by onFailure if the session is still valid
		public void doFailureAction() {
			errorLabelDisplay.setText(SERVER_ERROR);
		}

		public void onSuccess(List<ActionDTO> result) {
			dataProvider.setList(result);
		}
	});

	VerticalPanel displayPanel = new VerticalPanel();
	displayPanel.add(pager);
	displayPanel.add(table);
	displayPanel.add(errorLabelDisplay);
	displayPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
	ActionPanel.add(displayPanel);

	VerticalPanel vPanel = new VerticalPanel();
	final Label errorLabelControl = new Label();
	HorizontalPanel controlPanel = new HorizontalPanel();
	controlPanel.addStyleName("essencePanel");
	controlPanel.setSpacing(10);
	setupControlPanel(controlPanel, errorLabelControl, dataProvider);
	vPanel.add(controlPanel);	
    
	vPanel.add(errorLabelControl);
	dPanel.addNorth(vPanel, 10);
}
 
Example 21
Project: essence   File: DecisionRuleUI.java   View Source Code Vote up 4 votes
public void setupDecisionRulePanel(ScrollPanel analyzerPanel, DockLayoutPanel dPanel) {
	

	final Label errorLabelDisplay = new Label();

	// Create a CellTable.
	final CellTable<DecisionRuleDTO> table = new CellTable<>();
	setupDecisionRuleDisplayPanel(table, errorLabelDisplay);

	SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
	SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 10, true);
	pager.setDisplay(table);
	dataProvider.addDataDisplay(table);

	final SingleSelectionModel<DecisionRuleDTO> selectionModel = new SingleSelectionModel<>();
    table.setSelectionModel(selectionModel);

	greetingService.getDecisionRules(new AsyncCallbackAdapter<List<DecisionRuleDTO>>() {
		// Called by onFailure if the session is still valid
		public void doFailureAction() {
			errorLabelDisplay.setText(SERVER_ERROR);
		}

		public void onSuccess(List<DecisionRuleDTO> result) {
			dataProvider.setList(result);
		}
	});

	VerticalPanel displayPanel = new VerticalPanel();
	displayPanel.add(pager);
	displayPanel.add(table);
	displayPanel.add(errorLabelDisplay);
	displayPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
	analyzerPanel.add(displayPanel);
	
	VerticalPanel vPanel = new VerticalPanel();
	final Label errorLabelActivateDetector = new Label();
	HorizontalPanel addRuleAndFilterPanel = new HorizontalPanel();
	addRuleAndFilterPanel.addStyleName("essencePanel");
	addRuleAndFilterPanel.setSpacing(10);
	setupControlPanel(addRuleAndFilterPanel, errorLabelActivateDetector, dataProvider);
	vPanel.add(addRuleAndFilterPanel);	
    
	vPanel.add(errorLabelActivateDetector);
	dPanel.addNorth(vPanel, 10);
}
 
Example 22
Project: x-cure-chat   File: ForumMessageWidget.java   View Source Code 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 23
Project: x-cure-chat   File: ForumBodyWidget.java   View Source Code Vote up 4 votes
/**
 * The basic constructor provided with the site section url prefix
 * @param siteSectionPrefix the history token site section prefix
 */
ForumBodyWidget( final String siteSectionPrefix ) {
	super();
	
	//The forum's search panel
	this.searchPanel = new ForumSearchPanel( false );
	forumBodyComponents.add( searchPanel );
	//The forum's messages panel
	this.messagesPanel = new ForumMessagesPanel( true, true, true, siteSectionPrefix );
	forumBodyComponents.add( messagesPanel );
	//The forum's message stack navigator
	this.stackNavigator = new MessagesStackNavigator( false, messagesPanel, searchPanel, siteSectionPrefix );
	forumBodyComponents.add( stackNavigator );
	
	//Set up the forum manager
	ForumSearchManager.setForumUIComponents( searchPanel, stackNavigator, messagesPanel, this );
	
	//Register the avatar image spoiler listener
	UserAvatarImageWidget.addAvatarSpoilerChangeListener( this );
	
	//Initialize the main vetical panel
	forumPanel.setWidth("100%");
	forumPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	
	//Add the search and navigator panels to a wrapping decorated panel
	final VerticalPanel searchNavPanel = new VerticalPanel();
	searchNavPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_LEFT );
	final DecoratorPanel decPanel = new DecoratorPanel();
	decPanel.setStyleName( CommonResourcesContainer.GRAY_ROUNDED_CORNER_PANEL_STYLE );
	decPanel.add( searchNavPanel );
	forumPanel.add( decPanel );
	
	//Add the search panel
	searchPanel.setWidth("100%");
	searchNavPanel.add( searchPanel );
	
	//Add the messages stack navigator
	stackNavigator.setWidth("100%");
	searchNavPanel.add( stackNavigator );
	
	//Add Messages panel
	forumPanel.add( messagesPanel );
	
	//Initialize the composite
	initWidget( forumPanel );
}
 
Example 24
Project: x-cure-chat   File: UserAvatarWidget.java   View Source Code Vote up 4 votes
/**
 * The basic constructor
 * @param userData the short user data for which the avatar is created
 * @param flags the flags that indicate what kind of data to display
 * 			note that, the avatar image and the user name can be displayed always,
 * 			other data can only be displayed for an existing user.
 */
public UserAvatarWidget( final ShortUserData userData, final int flags ) {
	//Store the user data
	this.userData = userData;
	
	//Check on whether the user of this avatar still exists
	doesSenderExist =  ( userData.getUID() != ShortUserData.UNKNOWN_UID ) &&
					   ! ShortUserData.DELETED_USER_LOGIN_NAME.equals( userData.getUserLoginName() );
	
	//Add the sub-panel with the avatar
	final VerticalPanel avatarVerticalPanel = new VerticalPanel();
	avatarVerticalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	avatarVerticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	
	//Add the avatar image, if needed
	if( ( flags & DISPLAY_AVATAR_IMAGE_DATA ) > 0 ) {
		displayAvatarImage( avatarVerticalPanel );
	}
	
	//The additional user data is only displayed if the user exists
	if( doesSenderExist ) {
		//Add the user money count, if needed
		if( ( flags & DISPLAY_MONEY_DATA ) > 0 ) {
			displayMoney( avatarVerticalPanel );
		}
		
		//Add the user forum messages count, if needed
		if( ( flags & DISPLAY_FORUM_POSTS_DATA ) > 0 ) {
			displayForumPosts( avatarVerticalPanel );
		}
		
		//Add the user chat messages count, if needed
		if( ( flags & DISPLAY_CHAT_MESSAGES_DATA ) > 0 ) {
			displayChatMessages( avatarVerticalPanel );
		}
		
		//Add the user time on site, if needed
		if( ( flags & DISPLAY_TIME_ON_SITE_DATA ) > 0 ) {
			displayTimeOnSite( avatarVerticalPanel );
		}
		
		//Add the is-online status, if needed
		if( ( flags & DISPLAY_REGISTRATION_DATA ) > 0 ) {
			displayRegTime( avatarVerticalPanel );
		}
		
		//Add the user's last visit date, if needed
		if( ( flags & DISPLAY_USER_VISIT_DATA ) > 0 ) {
			displayLastVisitDate( avatarVerticalPanel );
		}
	}
	
	//Add the user name, if needed
	if( ( flags & DISPLAY_USER_NAME_DATA ) > 0 ) {
		displayUserName( avatarVerticalPanel );
	}
	
	//Add the avatar fields to the focus panel and set its title
	avatarFocusPanel.setTitle( userData.getUserLoginName() );
	avatarFocusPanel.add( avatarVerticalPanel );
	
	//Initialize the widget
	initWidget( avatarFocusPanel );
}
 
Example 25
Project: onecmdb   File: HeaderScreen.java   View Source Code Vote up 4 votes
public HeaderScreen() {
    HorizontalPanel outer = new HorizontalPanel();
    VerticalPanel inner = new VerticalPanel();
    outer.setWidth("100%");
    outer.setHeight("3em");
    
    //outer.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    inner.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT);
    inner.setWidth("100%");
    inner.setHeight("100%");
    
    
    HorizontalPanel authInfo = new HorizontalPanel();
    //authInfo.setSpacing(4);
    logout.setStyleName("logout-style");
    authInfo.add(welcomeString);
    authInfo.add(logout);
    logout.setVisible(false);
    logout.addClickListener(this);
    inner.add(authInfo);
 
    HorizontalPanel actionPanel = new HorizontalPanel();
    actionPanel.setStyleName("onecmdb-header-label");
    actionPanel.setSpacing(10);
    actionPanel.add(getFeedbackWidget());
    actionPanel.add(getCheckUpdateWidget());
    
    actionPanel.add(getHomeWidegt());
    actionPanel.add(getHelpWidget());
    
    inner.add(actionPanel);
    inner.setCellVerticalAlignment(actionPanel, VerticalPanel.ALIGN_BOTTOM);
    inner.setCellVerticalAlignment(authInfo, VerticalPanel.ALIGN_TOP);
     
    
    //DockPanel iconPanel = new DockPanel();
    //iconPanel.setWidth("100%");
    //welcomePanel.setSpacing(10);
    //iconPanel.add(icon,DockPanel.EAST);
//    welcomePanel.add(new HTML("<b>&nbsp;</b>"),DockPanel.CENTER);
    outer.add(icon);
    outer.setCellHorizontalAlignment(icon, HorizontalPanel.ALIGN_LEFT);
    outer.add(inner);
    outer.setCellHorizontalAlignment(inner, HorizontalPanel.ALIGN_RIGHT);
    
    
    // Show welcome page.
    icon.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			getBaseEntryScreen().showScreen(OneCMDBApplication.WELCOME_SCREEN);
		}
    });
    
    initWidget(outer);
    //outer.setStyleName("one-top-panel");
  }
 
Example 26
Project: sc2gears   File: ClientUtils.java   View Source Code Vote up 4 votes
/**
 * Displays a Details dialog box.<br>
 * Renders a table with 2 columns: name and value pairs.
 * @param caption title of the dialog
 * @param values  values to be displayed; each element is an array (name-value pair) which defines a row
 */
public static void displayDetailsDialog( final String caption, final Object[][] values ) {
	final DialogBox dialogBox = new DialogBox( true );
	dialogBox.setText( caption );
	dialogBox.setGlassEnabled( true );
	
	final VerticalPanel content = new VerticalPanel();
	content.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	
	final FlexTable table = new FlexTable();
	table.setBorderWidth( 1 );
	table.setCellSpacing( 0 );
	table.setCellPadding( 3 );
	
	
	final CellFormatter cellFormatter = table.getCellFormatter();
	for ( int i = 0; i < values.length; i++ ) {
		// Name
		table.setWidget( i, 0, new Label( values[ i ][ 0 ].toString() ) );
		cellFormatter.addStyleName( i, 0, "headerRow" );
		
		final Object value = values[ i ] [ 1 ];
		
		if ( value == null )
			table.setWidget( i, 1, new Label() );
		else if ( value instanceof Widget ) 
			table.setWidget( i, 1, (Widget) value );
		else if ( value instanceof Date )
			table.setWidget( i, 1, createTimestampWidget( (Date) value ) );
		else {
			String stringValue;
			if ( value instanceof String )
				stringValue = (String) value;
			else if ( value instanceof Number )
				stringValue = NUMBER_FORMAT   .format( (Number) value );
			else
				stringValue = value.toString();
			table.setWidget( i, 1, new Label( stringValue ) );
		}
		cellFormatter.addStyleName( i, 1, "row" + ( i & 0x01 ) );
		cellFormatter.setHorizontalAlignment( i, 1, HasHorizontalAlignment.ALIGN_LEFT );
	}
	
	content.add( table );
	
	content.add( createVerticalEmptyWidget( 8 ) );
	content.add( ClientUtils.createDialogCloseButton( dialogBox, "Close" ) );
	content.add( createVerticalEmptyWidget( 8 ) );
	
	dialogBox.setWidget( content );
	
	dialogBox.center();
}
 
Example 27
Project: ontobrowser   File: EditTermPopup.java   View Source Code Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
	
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
		}
	});
							
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
			
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(new Label("Definition:"));
	dialogVPanel.add(definitionField);
	dialogVPanel.add(definitionError);
	dialogVPanel.add(new Label("URL:"));
	dialogVPanel.add(urlField);
	dialogVPanel.add(urlError);
	dialogVPanel.add(new Label("Comments:"));
	dialogVPanel.add(commentsField);
	dialogVPanel.add(commentsError);
	
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
	for(Widget widget : dialogVPanel) {
		if(widget instanceof Label) {
			Label label = (Label)widget;
			if(label.getText().length() != 0) {
				label.addStyleName("dialog-label");
			} else {
				label.addStyleName("dialog-error");
			}
		}
	}
	
	dialogBox.setWidget(dialogVPanel);
}
 
Example 28
Project: ontobrowser   File: AddSynonymPopup.java   View Source Code Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			synonymField.setValue(null);
			synonymError.setText(null);
			typeDropBox.setSelectedIndex(typeDropBox.getItemCount()-1);
			sourceDropBox.setSelectedIndex(0);
			referenceIdField.setEnabled(false); 
			referenceIdField.setValue(null);
			addButton.setEnabled(false);
			dialogBox.hide();
		}
	});
	
	buttonsHPanel.add(addButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
	
	dialogVPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(new Label("Synonym:"));
	dialogVPanel.add(synonymField);
	dialogVPanel.add(synonymError);
	dialogVPanel.add(new Label("Type:"));
	dialogVPanel.add(typeDropBox);
	dialogVPanel.add(typeError);
	dialogVPanel.add(new Label("Source:"));
	dialogVPanel.add(sourceDropBox);
	dialogVPanel.add(sourceError);
	dialogVPanel.add(new Label("Reference Id:"));
	dialogVPanel.add(referenceIdField);
	dialogVPanel.add(referenceIdError);
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
	for(Widget widget : dialogVPanel) {
		if(widget instanceof Label) {
			Label label = (Label)widget;
			if(label.getText().length() != 0) {
				label.addStyleName("dialog-label");
			} else {
				label.addStyleName("dialog-error");
			}
		}
	}
	
	dialogBox.setWidget(dialogVPanel);
}
 
Example 29
Project: ontobrowser   File: ChangePasswordPopup.java   View Source Code Vote up 4 votes
private void addDialogWidgets() {
	VerticalPanel dialogVPanel = new VerticalPanel();
	HorizontalPanel buttonsHPanel = new HorizontalPanel();
	Button cancelButton = new Button("Cancel");
			
	cancelButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			newPasswordTextBox1.setText(null);
			newPasswordTextBox2.setText(null);
			passwordError.setText(null);
			dialogBox.hide();
		}
	});
	
	grid.setWidget(0, 1, oldPasswordTextBox);
	grid.setWidget(1, 1, newPasswordTextBox1);
	grid.setWidget(2, 1, newPasswordTextBox2);
	grid.addStyleName("gwt-Grid");
	for(int i = 0; i < LABELS.length; i++) {
		grid.setText(i, 0, LABELS[i] + ":");
	}
			
	CellFormatter cellFormatter = grid.getCellFormatter(); 
	for(int row = 0; row < grid.getRowCount(); row++) {
		cellFormatter.addStyleName(row, 0, "dialog-label");
	}
	
	passwordError.addStyleName("dialog-error");
	
	buttonsHPanel.add(updateButton);
	buttonsHPanel.add(cancelButton);
	buttonsHPanel.addStyleName("dialog-buttons");	
	
	dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
	dialogVPanel.add(grid);		
	dialogVPanel.add(passwordError);
	dialogVPanel.add(buttonsHPanel);
	dialogVPanel.setCellHorizontalAlignment(buttonsHPanel, VerticalPanel.ALIGN_CENTER);
	
			
	dialogBox.setWidget(dialogVPanel);
}