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

The following are Jave code examples for showing how to use setCellHorizontalAlignment() 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: appinventor-extensions   File: Icon.java   View Source Code Vote up 6 votes
/**
 * Creates a new icon with the specified caption.
 *
 * @param image  image shown on icon (preferably 16 x 16px)
 * @param caption  caption shown below image
 */
public Icon(Image image, String caption) {

  panel = new VerticalPanel() {
    @Override
    public void onBrowserEvent(Event event) {
      Icon.this.onBrowserEvent(event);
    }
  };
  panel.add(image);
  panel.setCellHorizontalAlignment(image, VerticalPanel.ALIGN_CENTER);
  captionLabel = new Label(caption);
  panel.add(captionLabel);

  initWidget(panel);

  setStylePrimaryName("ode-Icon");
}
 
Example 2
Project: document-management-system   File: DebugConsolePopup.java   View Source Code Vote up 6 votes
/**
 * Logout popup
 */
public DebugConsolePopup() {
	// Establishes auto-close when click outside
	super(false, false);

	setText(Main.i18n("debug.console.label"));
	vPanel = new VerticalPanel();
	button = new Button(Main.i18n("button.close"), this);
	text = new HTML(Main.i18n("debug.enable.disable"));

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(Log.getLogger(DivLogger.class).getWidget());
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	Log.getLogger(DivLogger.class).getWidget().setVisible(true);
	setWidget(vPanel);
}
 
Example 3
Project: document-management-system   File: LogoutPopup.java   View Source Code Vote up 6 votes
/**
 * Logout popup
 */
public LogoutPopup() {
	// Establishes auto-close when click outside
	super(false, true);

	vPanel = new VerticalPanel();
	text = new HTML(Main.i18n("logout.logout"));
	button = new Button(Main.i18n("button.close"), this);

	vPanel.setWidth("250px");
	vPanel.setHeight("100px");

	vPanel.add(new HTML("<br>"));
	vPanel.add(text);
	vPanel.add(new HTML("<br>"));
	vPanel.add(button);
	vPanel.add(new HTML("<br>"));

	vPanel.setCellHorizontalAlignment(text, VerticalPanel.ALIGN_CENTER);
	vPanel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);

	button.setStyleName("okm-YesButton");

	super.hide();
	setWidget(vPanel);
}
 
Example 4
Project: document-management-system   File: WorkflowWidget.java   View Source Code Vote up 6 votes
/**
 * WorkflowWidget
 */
public WorkflowWidget(String name, String uuid, WorkflowWidgetToFire workflowWidgetToFire, Map<String, Object> workflowVariables) {
	this.name = name;
	this.uuid = uuid;
	this.workflowWidgetToFire = workflowWidgetToFire;
	this.workflowVariables = workflowVariables;
	drawed = false;

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

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

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

	vPanel.setCellHorizontalAlignment(hPanel, VerticalPanel.ALIGN_CENTER);

	initWidget(vPanel);
}
 
Example 5
Project: gwt-uploader   File: SourceCodePopupPanel.java   View Source Code Vote up 6 votes
public SourceCodePopupPanel() {
  // PopupPanel's constructor takes 'auto-hide' as its boolean parameter.
  // If this is set, the panel closes itself automatically when the user
  // clicks outside of it.
  super(true);
  // Set the dialog box's caption.
  setText("Source Code");

  // Enable animation.
  setAnimationEnabled(true);

  // Enable glass background.
  setGlassEnabled(true);
  Button btnClose = new Button("Close");
  btnClose.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      hide();
    }
  });
  VerticalPanel panel = new VerticalPanel();
  panel.add(html);
  panel.add(btnClose);
  panel.setCellHorizontalAlignment(btnClose, HasHorizontalAlignment.ALIGN_RIGHT);
  setWidget(panel);
}
 
Example 6
Project: Wiab.pro   File: DialogBox.java   View Source Code Vote up 6 votes
/**
 * Creates dialog box.
 *
 * @param popup - UniversalPopup on which the dialog is based
 * @param title - title placed in the title bar
 * @param innerWidget - the inner widget of the dialog
 * @param dialogButtons - buttons
 */
public static void create(UniversalPopup popup, String title, Widget innerWidget,
    DialogButton[] dialogButtons) {
  // Title
  popup.getTitleBar().setTitleText(title);

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

  // Message
  contents.add(innerWidget);

  // Buttons
  HorizontalPanel buttonPanel = new HorizontalPanel();
  for (DialogButton dialogButton : dialogButtons) {
    Button button = new Button(dialogButton.getTitle());
    button.setStyleName(Dialog.getCss().dialogButton());
    buttonPanel.add(button);
    dialogButton.link(button);
  }
  contents.add(buttonPanel);
  buttonPanel.setStyleName(Dialog.getCss().dialogButtonPanel());
  contents.setCellHorizontalAlignment(buttonPanel, HasHorizontalAlignment.ALIGN_RIGHT);
}
 
Example 7
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 8
Project: firefly   File: BasicImageGrid.java   View Source Code Vote up 6 votes
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();
}
 
Example 9
Project: firefly   File: ColorPicker.java   View Source Code Vote up 6 votes
public ColorPickerPopup(ColorChooserPanel colorPicker, boolean showLinks, boolean autoClose)
{
	super(autoClose, true);
	
	this.showLinks = showLinks;
	
	VerticalPanel vpanel = new VerticalPanel();
	vpanel.add(colorPicker);
	
	if (showLinks)
	{
		HorizontalPanel hpanel = new HorizontalPanel();
		cancel.addStyleName("agilar-colorpicker-popup-link");
		ok.addStyleName("agilar-colorpicker-popup-link");
		cancel.addClickHandler(this);
		ok.addClickHandler(this);
		hpanel.add(cancel);
		hpanel.add(ok);
		vpanel.add(hpanel);
		vpanel.setCellHorizontalAlignment(hpanel, VerticalPanel.ALIGN_RIGHT);
	}
	setWidget(vpanel);
}
 
Example 10
Project: appinventor-extensions   File: Box.java   View Source Code Vote up 5 votes
/**
 * Creates a button with a click handler which will execute the given command.
 */
private void addControlButton(VerticalPanel panel, String caption, final Command command) {
  TextButton button = new TextButton(caption);
  button.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      command.execute();
    }
  });
  panel.add(button);
  panel.setCellHorizontalAlignment(button, VerticalPanel.ALIGN_CENTER);
}
 
Example 11
Project: onecmdb   File: LoginScreen.java   View Source Code Vote up 5 votes
public LoginScreen() {
    VerticalPanel vPanel = new VerticalPanel();
    txtPassword.setConvertToUpper(false);
    txtLogin.setConvertToUpper(false);
    
	txtLogin.setRequired(true);
    vp.add(txtLogin);
    vp.add(txtPassword);
    
    addExtraInputFields(vp);
    
    rememberMe.setChecked(true);
    rememberMe.setStyleName("one-remember-me");
    vp.add(rememberMe);
    vp.setCellHorizontalAlignment(rememberMe, HorizontalPanel.ALIGN_RIGHT);
    
    ButtonPanel btnPanel = new ButtonPanel();
    btnPanel.addSaveButton("Login");
    btnPanel.addClearButton();
    btnPanel.setCallback(this);
    vp.add(btnPanel);
    vp.setCellHorizontalAlignment(btnPanel, HorizontalPanel.ALIGN_LEFT);

    setTitleText("Please Login");
    

    //dockPanel.add(vp, DockPanel.NORTH);
    vPanel.add(vp);
    vPanel.setCellHorizontalAlignment(vp, HorizontalPanel.ALIGN_CENTER);
    vPanel.setCellVerticalAlignment(vp, HorizontalPanel.ALIGN_MIDDLE);
    vPanel.setStyleName("mdv-form");
    
    dockPanel.add(vPanel, NORTH);
    dockPanel.setCellHeight(vPanel, "100%");
    initWidget(dockPanel);

}
 
Example 12
Project: gerrit-ci   File: ProjectConfigurationScreen.java   View Source Code Vote up 5 votes
public static DialogBox alertWidget(final String header, final String content) {
    final DialogBox dialogBox = new DialogBox();
    final VerticalPanel verticalPanel = new VerticalPanel();

    final Label emptyLabel = new Label("");
    emptyLabel.setSize("auto", "25px");

    dialogBox.setText(header);

    verticalPanel.add(emptyLabel);
    verticalPanel.add(new Label(content));
    verticalPanel.add(emptyLabel);

    final Button buttonClose = new Button("Close", new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            dialogBox.hide();
        }
    });
    buttonClose.setWidth("100px");
    verticalPanel.add(buttonClose);
    verticalPanel.setCellHorizontalAlignment(buttonClose, HasAlignment.ALIGN_CENTER);

    dialogBox.add(verticalPanel);
    dialogBox.setWidth("400px");
    return dialogBox;
}
 
Example 13
Project: gerrit-ci   File: ConfigurationScreen.java   View Source Code Vote up 5 votes
/**
 * Creates a DialogBox object with the specified header and content and
 * returns it to be displayed.
 *
 * @param header
 *            Title for the alert dialog
 * @param content
 *            Inner message content to display
 * @return A DialogBox object configured with the specified strings
 */
public static DialogBox alertWidget(final String header,
		final String content) {
	final DialogBox dialogBox = new DialogBox();
	final VerticalPanel verticalPanel = new VerticalPanel();

	final Label emptyLabel = new Label("");
	emptyLabel.setSize("auto", "25px");

	dialogBox.setText(header);

	verticalPanel.add(emptyLabel);
	verticalPanel.add(new Label(content));
	verticalPanel.add(emptyLabel);

	final Button buttonClose = new Button("Close", new ClickHandler() {

		@Override
		public void onClick(final ClickEvent event) {
			dialogBox.hide();
		}
	});
	buttonClose.setWidth("100px");
	verticalPanel.add(buttonClose);
	verticalPanel.setCellHorizontalAlignment(buttonClose,
			HasAlignment.ALIGN_CENTER);

	dialogBox.add(verticalPanel);
	return dialogBox;
}
 
Example 14
Project: firefly   File: CatalogSearchDropDown.java   View Source Code Vote up 5 votes
private Widget createSearchCatalogsContent(String projectId) {
        _catalogPanel = new CatalogPanel(null, projectId);
        _catalogPanel.setSize("95%", "95%");
        _catalogPanel.addKeyPressOnCreation(keyPressHandler);

//        HorizontalPanel buttons= new HorizontalPanel();
//        buttons.addStyleName("base-dialog-buttons");
//        GwtUtil.setStyle(buttons, "cssFloat", "none");
//        buttons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

        FlowPanel buttons= new FlowPanel();
        buttons.setWidth("100%");

        Button ok= new Button("Search");
        ok.addStyleName("highlight-text");
        ok.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent ev) { doOK(); }
        });

        buttons.add(ok);
        Widget help= HelpManager.makeHelpIcon("basics.catalog");
        buttons.add(help);

        GwtUtil.setStyles(ok, "cssFloat", "left",
                                "margin", "0 0 0 37px",
                                "color", "black",
                                "fontWeight", "bold");

        GwtUtil.setStyles(help, "cssFloat", "right",
                          "", "0 20px 0 0");


        VerticalPanel vp= new VerticalPanel();
        vp.add(_catalogPanel);
        vp.add(buttons);

        vp.setCellHorizontalAlignment(_catalogPanel, VerticalPanel.ALIGN_CENTER);
        vp.setSize("95%", "450px");
        return vp;
    }
 
Example 15
Project: fullmetalgalaxy   File: MAppContext.java   View Source Code Vote up 5 votes
public MAppContext()
{
  super();

  AppRoot.getEventBus().addHandler( ModelUpdateEvent.TYPE, this );
  VerticalPanel vpanel = new VerticalPanel();
  vpanel.add( m_panelAction );
  vpanel.setCellHorizontalAlignment( m_panelAction, HasHorizontalAlignment.ALIGN_RIGHT );
  HorizontalPanel hpanel = new HorizontalPanel();

  hpanel.add( m_panelExtra );
  hpanel.setCellHeight( m_panelExtra, "100%" );
  m_panelExtra.setHeight( "100%" );
  hpanel.add( m_panelMiniMap );

  vpanel.add( hpanel );


  m_panelAction.add( new WgtContextAction() );
  m_panelAction.setStylePrimaryName( "fmp-context-action" );
  m_panelMiniMap.setStylePrimaryName( "fmp-context-minimap" );
  m_panelMiniMap.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
  m_panelMiniMap.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
  // m_panelMiniMap.addStyleName( "transparent50" );
  m_panelExtra.add( new WgtContextExtra() );
  m_panelExtra.setStylePrimaryName( "fmp-context-extra" );
  // m_panelExtra.addStyleName( "transparent50" );

  initWidget( vpanel );
  hpanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
}
 
Example 16
Project: appinventor-extensions   File: TopPanel.java   View Source Code Vote up 4 votes
private void addMotd(VerticalPanel panel) {
  MotdBox motdBox = MotdBox.getMotdBox();
  panel.add(motdBox);
  panel.setCellHorizontalAlignment(motdBox, HorizontalPanel.ALIGN_RIGHT);
  panel.setCellVerticalAlignment(motdBox, HorizontalPanel.ALIGN_BOTTOM);
}
 
Example 17
Project: document-management-system   File: TabWorkspace.java   View Source Code Vote up 4 votes
/**
 * TabWorkspace
 */
public TabWorkspace() {
	vPanel = new VerticalPanel();
	iframe = new Frame("about:blank");

	DOM.setElementProperty(iframe.getElement(), "frameborder", "0");
	DOM.setElementProperty(iframe.getElement(), "marginwidth", "0");
	DOM.setElementProperty(iframe.getElement(), "marginheight", "0");

	// Commented because on IE show clear if allowtransparency=true
	DOM.setElementProperty(iframe.getElement(), "allowtransparency", "false");
	DOM.setElementProperty(iframe.getElement(), "scrolling", "auto");

	iframe.setUrl(Main.CONTEXT + "/extra/index.jsp");
	iframe.setStyleName("okm-Iframe");

	vPanel.add(iframe);
	vPanel.setCellHorizontalAlignment(iframe, HasAlignment.ALIGN_CENTER);

	vPanel.setWidth("100%");
	vPanel.setHeight("100%");

	// User workspace values
	if (GeneralComunicator.getWorkspace() == null) {
		timer = new Timer() {
			@Override
			public void run() {
				if (GeneralComunicator.getWorkspace() == null) {
					firstTimeLoadingWorkspace();
				} else {
					init();
				}
			}
		};

		firstTimeLoadingWorkspace();
	} else {
		init();
	}

	initWidget(vPanel);
}
 
Example 18
Project: gwt-uploader   File: ImageButtonAndProgressText.java   View Source Code Vote up 4 votes
@Override
public Widget getUploaderPanel() {
  progressLabel.setStyleName("progressLabel");
  uploader.setUploadURL("/upload")
      .setButtonImageURL(AppResources.INSTANCE.upload().getSafeUri().asString())
      .setButtonWidth(133)
      .setButtonHeight(22)
      .setFileSizeLimit("50 MB")
      .setButtonCursor(Uploader.Cursor.HAND)
      .setButtonAction(Uploader.ButtonAction.SELECT_FILE)
      .setUploadProgressHandler(new UploadProgressHandler() {
        public boolean onUploadProgress(UploadProgressEvent uploadProgressEvent) {
          progressLabel.setText(
              NumberFormat.getPercentFormat().format(
                  uploadProgressEvent.getBytesComplete() / uploadProgressEvent.getBytesTotal()
              )
          );
          return true;
        }
      })
      .setUploadSuccessHandler(new UploadSuccessHandler() {
        public boolean onUploadSuccess(UploadSuccessEvent uploadSuccessEvent) {
          resetText();
          StringBuilder sb = new StringBuilder();
          sb.append("File ").append(uploadSuccessEvent.getFile().getName())
              .append(" uploaded successfully at ")
              .append(NumberFormat.getDecimalFormat().format(
                  uploadSuccessEvent.getFile().getAverageSpeed() / 1024
              ))
              .append(" kilobit per second");
          progressLabel.setText(sb.toString());
          return true;
        }
      })
      .setFileDialogCompleteHandler(new FileDialogCompleteHandler() {
        public boolean onFileDialogComplete(FileDialogCompleteEvent fileDialogCompleteEvent) {
          if (fileDialogCompleteEvent.getTotalFilesInQueue() > 0
              && uploader.getStats().getUploadsInProgress() <= 0) {
            progressLabel.setText("0%");
            uploader.startUpload();
          }
          return true;
        }
      })
      .setFileQueueErrorHandler(new FileQueueErrorHandler() {
        public boolean onFileQueueError(FileQueueErrorEvent fileQueueErrorEvent) {
          resetText();
          Window.alert(
              "Upload of file " + fileQueueErrorEvent.getFile().getName() + " failed due to [" +
              fileQueueErrorEvent.getErrorCode().toString() + "]: " + fileQueueErrorEvent
                  .getMessage()
          );
          return true;
        }
      })
      .setUploadErrorHandler(new UploadErrorHandler() {
        public boolean onUploadError(UploadErrorEvent uploadErrorEvent) {
          resetText();
          Window
              .alert(
                  "Upload of file " + uploadErrorEvent.getFile().getName() + " failed due to [" +
                  uploadErrorEvent.getErrorCode().toString() + "]: " + uploadErrorEvent
                      .getMessage()
              );
          return true;
        }
      });

  VerticalPanel verticalPanel = new VerticalPanel();
  verticalPanel.add(uploader);
  verticalPanel.add(progressLabel);
  verticalPanel.setCellHorizontalAlignment(uploader, HorizontalPanel.ALIGN_LEFT);
  verticalPanel.setCellHorizontalAlignment(progressLabel, HorizontalPanel.ALIGN_LEFT);
  return verticalPanel;
}
 
Example 19
Project: gwt-uploader   File: TextButtonAndProgressText.java   View Source Code Vote up 4 votes
@Override
public Widget getUploaderPanel() {
  progressLabel.setStyleName("progressLabel");
  uploader.setUploadURL("/upload")
      .setButtonText("<span class=\"buttonText\">Click to Upload</span>")
      .setButtonTextStyle(
          ".buttonText {font-family: Arial, sans-serif; font-size: 14px; color: #BB4B44}")
      .setFileSizeLimit("50 MB")
      .setButtonWidth(150)
      .setButtonHeight(22)
      .setButtonCursor(Uploader.Cursor.HAND)
      .setButtonAction(Uploader.ButtonAction.SELECT_FILE)
      .setUploadProgressHandler(new UploadProgressHandler() {
        public boolean onUploadProgress(UploadProgressEvent uploadProgressEvent) {
          progressLabel.setText(NumberFormat.getPercentFormat().format(
              (double) uploadProgressEvent.getBytesComplete() / (double) uploadProgressEvent
                  .getBytesTotal()
          ));
          return true;
        }
      })
      .setUploadSuccessHandler(new UploadSuccessHandler() {
        public boolean onUploadSuccess(UploadSuccessEvent uploadSuccessEvent) {
          resetText();
          StringBuilder sb = new StringBuilder();
          sb.append("File ").append(uploadSuccessEvent.getFile().getName())
              .append(" (")
              .append(NumberFormat.getDecimalFormat()
                          .format(uploadSuccessEvent.getFile().getSize() / 1024))
              .append(" KB)")
              .append(" uploaded successfully at ")
              .append(NumberFormat.getDecimalFormat().format(
                  uploadSuccessEvent.getFile().getAverageSpeed() / 1024
              ))
              .append(" Kb/second");
          progressLabel.setText(sb.toString());
          return true;
        }
      })
      .setFileDialogCompleteHandler(new FileDialogCompleteHandler() {
        public boolean onFileDialogComplete(FileDialogCompleteEvent fileDialogCompleteEvent) {
          if (fileDialogCompleteEvent.getTotalFilesInQueue() > 0
              && uploader.getStats().getUploadsInProgress() <= 0) {
            progressLabel.setText("0%");
            uploader.setButtonText("<span class=\"buttonText\">Uploading...</span>");
            uploader.startUpload();
          }
          return true;
        }
      })
      .setFileQueueErrorHandler(new FileQueueErrorHandler() {
        public boolean onFileQueueError(FileQueueErrorEvent fileQueueErrorEvent) {
          resetText();
          Window.alert(
              "Upload of file " + fileQueueErrorEvent.getFile().getName() + " failed due to [" +
              fileQueueErrorEvent.getErrorCode().toString() + "]: " + fileQueueErrorEvent
                  .getMessage()
          );
          return true;
        }
      })
      .setUploadErrorHandler(new UploadErrorHandler() {
        public boolean onUploadError(UploadErrorEvent uploadErrorEvent) {
          resetText();
          Window.alert(
              "Upload of file " + uploadErrorEvent.getFile().getName() + " failed due to [" +
              uploadErrorEvent.getErrorCode().toString() + "]: " + uploadErrorEvent.getMessage()
          );
          return true;
        }
      });

  VerticalPanel verticalPanel = new VerticalPanel();
  verticalPanel.add(uploader);
  verticalPanel.add(progressLabel);
  verticalPanel.setCellHorizontalAlignment(uploader, HorizontalPanel.ALIGN_LEFT);
  verticalPanel.setCellHorizontalAlignment(progressLabel, HorizontalPanel.ALIGN_LEFT);
  return verticalPanel;
}
 
Example 20
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 21
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 22
Project: ontobrowser   File: HistoryPopup.java   View Source Code 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 23
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);
}
 
Example 24
Project: firefly   File: ImageSelectDropDown.java   View Source Code Vote up 4 votes
private Widget createContents(PlotWidgetFactory plotFactory) {

        if (useNewPanel) {
            imSelPanel2= new ImageSelectPanel2(new DropDownComplete(), plotter);
        }
        else  {
            imSelPanel= new ImageSelectPanel(null,true,null,new DropDownComplete(),plotFactory);
        }
        HorizontalPanel buttons= new HorizontalPanel();
        buttons.addStyleName("base-dialog-buttons");
        buttons.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
        GwtUtil.setStyle(buttons, "paddingRight", "80px");

        Button ok= new Button("Load");
        ok.addStyleName("highlight-text");
        ok.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent ev) { doOK(); }
        });

        buttons.add(ok);
        buttons.add(HelpManager.makeHelpIcon("basics.catalog"));

        VerticalPanel vp= new VerticalPanel();
        Widget content;
        if (useNewPanel) {
            content= GwtUtil.centerAlign(imSelPanel2.getMainPanel());
        }
        else {
            content= GwtUtil.centerAlign(imSelPanel.getMainPanel());
        }
        vp.add(content);
        vp.add(buttons);

        vp.setCellHorizontalAlignment(content, VerticalPanel.ALIGN_CENTER);
        vp.setSize("95%", "450px");
        vp.setSpacing(3);
        content.setSize("95%", "95%");
        content.addStyleName("component-background");

        if (useNewPanel) {
            addKeyPressToAll(imSelPanel2.getMainPanel());
        }
        else {
            addKeyPressToAll(imSelPanel.getMainPanel());
        }

        return vp;
    }
 
Example 25
Project: firefly   File: ResizableLayoutManager.java   View Source Code Vote up 4 votes
public void layout(String rootId) {

        init();

        Region loginRegion = null;
        if (Application.getInstance().getLoginManager()!=null) {
            loginRegion = Application.getInstance().getLoginManager().makeLoginRegion();
        }

        HorizontalPanel hp = new HorizontalPanel();
        hp.add(getSmallIcon().getDisplay());
        hp.add(getSmallIcon2().getDisplay());
        VerticalPanel fp = new VerticalPanel();
        if (loginRegion!=null) {
            fp.add(loginRegion.getDisplay());
            fp.setCellHeight(loginRegion.getDisplay(), "20px");
            fp.setCellHorizontalAlignment(loginRegion.getDisplay(), HorizontalPanel.ALIGN_RIGHT);
        }
        fp.add(hp);
        fp.setCellHeight(hp, "52px");
        fp.setCellHorizontalAlignment(hp, VerticalPanel.ALIGN_CENTER);
        fp.setStyleName("user-info");
        RootPanel.get("user-info").add(fp);


        Widget north = makeNorth();
        Widget center = makeCenter();
        Widget south = makeSouth();
        if (north != null) {
            mainPanel.add(north, DockPanel.NORTH);
            mainPanel.setCellHeight(north, "10px");
//            GwtUtil.DockLayout.setWidgetSize(north, getNorthHeight());
        }

//        if (south != null) {
//            mainPanel.add(south, DockPanel.SOUTH);
//            mainPanel.setCellHeight(south, "60px");
//        }
//
        if (center != null) {
            mainPanel.add(center, DockPanel.CENTER);
            GwtUtil.setStyle(center, "padding", "0 10px");
        }


        if (rootId != null) {
            RootPanel root = RootPanel.get(rootId);
            if (root == null) {
                throw new RuntimeException("Application is not setup correctly; unable to find " + rootId);
            }
            root.add(mainPanel);
        } else {
            RootPanel.get().add(mainPanel);
        }
//        mainPanel.add(resizer, DockPanel.WEST);
//        mainPanel.setCellWidth(resizer, "15px");

        mainPanel.setSize("100%", "100%");

//        // now.. add the menu to the top
        getMenu().setDisplay(Application.getInstance().getToolBar().getWidget());
        resize();

    }