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

The following are Jave code examples for showing how to use add() 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: 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 2
Project: appinventor-extensions   File: Ode.java   View Source Code Vote up 6 votes
/**
 * This dialog is showned if an account is disabled. It is
 * completely modal with no escape. The provided URL is displayed in
 * an iframe, so it can be tailored to each person whose account is
 * disabled.
 *
 * @param Url the Url to display in the dialog box.
 */

public void disabledAccountDialog(String Url) {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.accountDisabledMessage());
  dialogBox.setHeight("700px");
  dialogBox.setWidth("700px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML("<iframe src=\"" + Url + "\" style=\"border: 0; width: 680px; height: 660px;\"></iframe>");
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 3
Project: appinventor-extensions   File: Ode.java   View Source Code Vote up 6 votes
/**
 * corruptionDialog -- Put up a dialog box explaining that we detected corruption
 * while reading in a project file. There is no continuing once this happens.
 *
 */
void corruptionDialog() {
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.corruptionDialogText());
  dialogBox.setHeight("100px");
  dialogBox.setWidth("400px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(MESSAGES.corruptionDialogMessage());
  message.setStyleName("DialogBox-message");
  DialogBoxContents.add(message);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 4
Project: appinventor-extensions   File: PropertiesPanel.java   View Source Code Vote up 6 votes
/**
 * Creates a new properties panel.
 */
public PropertiesPanel() {
  // Initialize UI
  VerticalPanel outerPanel = new VerticalPanel();
  outerPanel.setWidth("100%");

  componentName = new Label("");
  componentName.setStyleName("ode-PropertiesComponentName");
  outerPanel.add(componentName);

  panel = new VerticalPanel();
  panel.setWidth("100%");
  panel.setStylePrimaryName("ode-PropertiesPanel");
  outerPanel.add(panel);

  initWidget(outerPanel);
}
 
Example 5
Project: sig-seguimiento-vehiculos   File: GitHubExportDialog.java   View Source Code Vote up 6 votes
private Widget createAuthenticationPanel() {
	final VerticalPanel panel = new VerticalPanel();
	panel.getElement().getStyle().setBackgroundColor("#E0ECF8");
	panel.setWidth("350px");		
	panel.setSpacing(10);

	userNameField = new TextField();
	userNameField.setTitle(UIMessages.INSTANCE.gitHubUserNameField());
	userNameField.setEmptyText(UIMessages.INSTANCE.gitHubUserNameField());
	userNameField.setWidth(FIELD_WIDTH);
	panel.add(userNameField);

	passwordField = new PasswordField();		
	passwordField.setTitle(UIMessages.INSTANCE.gitHubPasswordField());
	passwordField.setEmptyText(UIMessages.INSTANCE.gitHubPasswordField());
	passwordField.setWidth(FIELD_WIDTH);
	panel.add(passwordField);
	
	return 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: document-management-system   File: WikiManager.java   View Source Code Vote up 6 votes
/**
 * WikiManager
 */
public WikiManager(boolean isDashboard) {
	this.isDashboard = isDashboard;
	vPanel = new VerticalPanel();
	toolbar = new TabToolbarWiki(this, isDashboard);

	// Post Editor
	vWikiPanel = new VerticalPanel();
	vWikiPanel.setWidth("100%");
	wikiEditor = new WikiEditor(this);
	wikiEditor.setStyleName("okm-Mail");
	wikiHistory = new WikiHistory(this);
	wikiPage = new WikiPage();
	scrollPanelWiki = new ScrollPanel(vWikiPanel);

	vPanel.add(toolbar); // Always visible

	toolbar.setHeight("" + TOOLBAR_HEADER + "px");
	toolbar.setWidth("100%");
	vPanel.setCellHeight(toolbar, "" + TOOLBAR_HEADER + "px");

	initWidget(vPanel);
}
 
Example 8
Project: document-management-system   File: MailDashboard.java   View Source Code Vote up 6 votes
/**
 * GeneralDashboard
 */
public MailDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

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

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

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

	initWidget(hPanel);
}
 
Example 9
Project: document-management-system   File: WorkflowDashboard.java   View Source Code Vote up 6 votes
/**
 * UserDashboard
 */
public WorkflowDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

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

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

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

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

	initWidget(hPanel);
}
 
Example 10
Project: Wiab.pro   File: ComplexColorPicker.java   View Source Code Vote up 6 votes
public ComplexColorPicker() {
  style.ensureInjected();

  // The background color can be set to "none"
  noneBtn = new PushButton(messages.none());
  noneBtn.addStyleName(ComplexColorPicker.style.buttonsMargins());
  noneBtn.setStylePrimaryName(ComplexColorPicker.style.customColorPushbutton());
  noneBtn.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      listener.onNoneColorChoose();
    }
  });

  vp = new VerticalPanel();

  // We use a simple color picker by default
  simplePicker = new SimpleColorPicker(this);
  vp.add(simplePicker);
  vp.add(noneBtn);
  super.add(vp);
}
 
Example 11
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 12
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 13
Project: gwt-uploader   File: GwtUploaderDemo.java   View Source Code Vote up 6 votes
@Override
public void onModuleLoad() {
  uploaderPanels.put("TextButtonAndProgressText", new TextButtonAndProgressText());
  uploaderPanels.put("ImageButtonAndProgressText", new ImageButtonAndProgressText());
  uploaderPanels.put("ImageButtonAndProgressBar", new ImageButtonAndProgressBar());
  uploaderPanels.put("MultiUploadWithProgressBar", new MultiUploadWithProgressBar());
  uploaderPanels.put("MultiUploadWithProgressBarAndDragAndDrop",
                     new MultiUploadWithProgressBarAndDragAndDrop());

  for (Map.Entry<String, UploaderSample> entry : uploaderPanels.entrySet()) {
    final UploaderSample sample = entry.getValue();
    final Widget uploaderPanel = sample.getUploaderPanel();
    final Button btnViewSource = new Button("View Source");
    btnViewSource.getElement().getStyle().setMarginTop(10, Style.Unit.PX);
    btnViewSource.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        sourceCodePopup.showSourceCode(sample.getUploaderCode());
      }
    });
    VerticalPanel panel = new VerticalPanel();
    panel.add(uploaderPanel);
    panel.add(btnViewSource);
    RootPanel.get(entry.getKey()).add(panel);
  }
}
 
Example 14
Project: document-management-system   File: FuturamaWalking.java   View Source Code Vote up 6 votes
/**
 * FuturamaWalking
 */
public FuturamaWalking() {
	// Establishes auto-close when click outside
	super(false, false);
	left = -180;
	top = Window.getClientHeight() - 80 - 21;

	vPanel = new VerticalPanel();
	vPanel.setWidth("186px");
	vPanel.setHeight("80px");

	logo = new Image("img/eastereggs/futurama_walking.gif");
	vPanel.add(logo);

	setPopupPosition(left, top);

	hide();
	setWidget(vPanel);
}
 
Example 15
Project: riscoss-corporate   File: RCPropertyPage.java   View Source Code Vote up 6 votes
public RCPropertyPage( SimpleRiskCconf rc ) {
	
	VerticalPanel p = new VerticalPanel();
	
	p.add( new Label( "Models per layer:" ) );
	
	p.add( mlist );
	
	try {
		loadModels( rc );
	}
	catch( Exception ex ) {
		Window.alert( ex.getMessage() );
	}
	

	tab.add( p, "Properties" );
	tab.selectTab( 0 );
	tab.setSize( "100%", "100%" );
}
 
Example 16
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 17
Project: riscoss-corporate   File: ConfigImportModule.java   View Source Code Vote up 6 votes
private void loadLayoutStructure() {
	
	page = new VerticalPanel();
	mainView = new HorizontalPanel();
	leftPanel = new VerticalPanel();
	
	mainView.setStyleName("mainViewLayer");
	mainView.setWidth("100%");
	leftPanel.setStyleName("leftPanelLayer");
	leftPanel.setWidth("700px");
	page.setWidth("100%");
	
	Label title = new Label("Import configuration");
	title.setStyleName("title");
	
	//Main layout
	page.add(title);
	page.add(mainView);
	
	//Left layout
	mainView.add(leftPanel);
	grid = new Grid(1,2);
	grid.setCellPadding(5);
	leftPanel.add(grid);
}
 
Example 18
Project: easy-vote   File: InfoPopup.java   View Source Code Vote up 6 votes
static public void popInfo(String title, String info) {
	final DialogBox dialogBox = new DialogBox();
	dialogBox.setText(title);
	dialogBox.setAnimationEnabled(true);
	
	VerticalPanel base = new VerticalPanel();
	base.add(new Label(info));
	Button closeButton = new Button("Close"); 
	base.add(closeButton);
	
	dialogBox.setWidget(base);
	
	// Add a handler to close the DialogBox
	closeButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			dialogBox.hide();
		}
	});
	
	dialogBox.center();
	closeButton.setFocus(true);
}
 
Example 19
Project: riscoss-corporate   File: EntityDataBox.java   View Source Code Vote up 6 votes
protected void showRiskData( JsonRiskDataList list ) {
		VerticalPanel p = new VerticalPanel();
		p.setWidth("100%");
		Grid grid = new Grid( list.size(), 2 );
//		grid.getColumnFormatter().setWidth(0, "20%");
//		grid.getColumnFormatter().setWidth(1, "80%");
		for( int i = 0; i < list.size(); i++ ) {
			JsonRiskDataList.RiskDataItem item = list.get( i );
			grid.setWidget( i, 0, new Label( item.getId() ) );
			grid.setWidget( i, 1, new Label( item.getValue() ) );
		}
		Label title = new Label(entity);
		title.setStyleName("smallTitle");
		p.add(title);
		p.add(grid);
		panel.setWidget( p );
	}
 
Example 20
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 21
Project: appinventor-extensions   File: TopToolbar.java   View Source Code Vote up 5 votes
@Override
public void execute() {
  final DialogBox db = new DialogBox(false, true);
  db.setText("About MIT App Inventor");
  db.setStyleName("ode-DialogBox");
  db.setHeight("200px");
  db.setWidth("400px");
  db.setGlassEnabled(true);
  db.setAnimationEnabled(true);
  db.center();

  VerticalPanel DialogBoxContents = new VerticalPanel();
  String html = MESSAGES.gitBuildId(GitBuildId.getDate(), GitBuildId.getVersion()) +
      "<BR/>Use Companion: " + BlocklyPanel.getCompVersion();
  Config config = Ode.getInstance().getSystemConfig();
  String releaseNotesUrl = config.getReleaseNotesUrl();
  if (!Strings.isNullOrEmpty(releaseNotesUrl)) {
    html += "<BR/><BR/>Please see <a href=\"" + releaseNotesUrl +
        "\" target=\"_blank\">release notes</a>";
  }
  String tosUrl = config.getTosUrl();
  if (!Strings.isNullOrEmpty(tosUrl)) {
    html += "<BR/><BR/><a href=\"" + tosUrl +
        "\" target=\"_blank\">" + MESSAGES.privacyTermsLink() + "</a>";
  }
  HTML message = new HTML(html);

  SimplePanel holder = new SimplePanel();
  Button ok = new Button("Close");
  ok.addClickListener(new ClickListener() {
    public void onClick(Widget sender) {
      db.hide();
    }
  });
  holder.add(ok);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  db.setWidget(DialogBoxContents);
  db.show();
}
 
Example 22
Project: appinventor-extensions   File: ProjectList.java   View Source Code Vote up 5 votes
/**
 * Creates a new ProjectList
 */
public ProjectList() {
  projects = new ArrayList<Project>();
  selectedProjects = new ArrayList<Project>();
  projectWidgets = new HashMap<Project, ProjectWidgets>();

  sortField = SortField.DATE_MODIFIED;
  sortOrder = SortOrder.DESCENDING;

  // Initialize UI
  table = new Grid(1, 5); // The table initially contains just the header row.
  table.addStyleName("ode-ProjectTable");
  table.setWidth("100%");
  table.setCellSpacing(0);
  nameSortIndicator = new Label("");
  dateCreatedSortIndicator = new Label("");
  dateModifiedSortIndicator = new Label("");
  publishedSortIndicator = new Label("");
  refreshSortIndicators();
  setHeaderRow();

  VerticalPanel panel = new VerticalPanel();
  panel.setWidth("100%");

  panel.add(table);
  initWidget(panel);

  // It is important to listen to project manager events as soon as possible.
  Ode.getInstance().getProjectManager().addProjectManagerEventListener(this);

  gallery = GalleryClient.getInstance();
}
 
Example 23
Project: sig-seguimiento-vehiculos   File: GitHubExportDialog.java   View Source Code Vote up 5 votes
private Widget createRepositoryPanel() {
	final VerticalPanel panel = new VerticalPanel();			
	panel.setWidth("350px");		
	panel.setSpacing(10);		
	
	repositoriesButton = new TextButton("...");
	repositoriesButton.setTitle(UIMessages.INSTANCE.gitHubTitleListRepo());
	
	
	final HorizontalPanel repositoryPanel = new HorizontalPanel();
	
	repositoryField = new TextField();
	repositoryField.setTitle(UIMessages.INSTANCE.gitHubRepositoryNameField());		
	repositoryField.setEmptyText(UIMessages.INSTANCE.gitHubRepositoryNameField());
	repositoryField.setWidth(FIELD_WIDTH);
	
	repositoryPanel.add(repositoryField);		
	repositoryPanel.add(repositoriesButton);
	
	panel.add(repositoryPanel);		
	
	pathField = new TextField();
	pathField.setTitle(UIMessages.INSTANCE.gitHubPathNameField());		
	pathField.setEmptyText(UIMessages.INSTANCE.gitHubPathNameField());
	pathField.setWidth(FIELD_WIDTH);
	
	TextButton pathButton = new TextButton("...");
	pathButton.addSelectHandler(getPathEvent());
	
	HorizontalPanel pathPanel = new HorizontalPanel();
	pathPanel.add(pathField);
	pathPanel.add(pathButton);
	
	panel.add(pathPanel);				

	return panel;
}
 
Example 24
Project: sig-seguimiento-vehiculos   File: OpenProjectDialog.java   View Source Code Vote up 5 votes
private VerticalPanel getURLPanel() {
	final VerticalPanel geoDataContainer = new VerticalPanel();
	geoDataContainer.setWidth("400px");
	geoDataContainer.setSpacing(3);

	geoDataContainer.add(new Label(UIMessages.INSTANCE.messageURLPanel()));

	urlTextField = new TextField();
	urlTextField.setBorders(true);
	urlTextField.setEmptyText("http://");
	urlTextField.setWidth(400);
	urlTextField.setAllowBlank(false);
	geoDataContainer.add(urlTextField);

	HorizontalPanel horizontalContainer = new HorizontalPanel();
	
	TextButton createUrlButton = new TextButton(
			UIMessages.INSTANCE.urlToShareButtonText());
	
	horizontalContainer.add(createUrlButton);
	
	createUrlButton.addSelectHandler(createUrlToShare(geoDataContainer));		
	geoDataContainer.add(horizontalContainer);
	geoDataContainer.add(createUrlToShareAnchor());

	urlShared = new TextField();
	urlShared.setBorders(true);
	urlShared.setWidth(400);
	urlShared.setVisible(false);
	geoDataContainer.add(urlShared);

	return geoDataContainer;
}
 
Example 25
Project: sig-seguimiento-vehiculos   File: SaveProjectDialog.java   View Source Code Vote up 5 votes
private Widget createPanel() {

		VerticalPanel vPanel = new VerticalPanel();
		vPanel.setPixelSize(315, 400);
		vPanel.setSpacing(5);
		vPanel.add(createTopPanel());

		return vPanel;
	}
 
Example 26
Project: sig-seguimiento-vehiculos   File: ExportDataDialog.java   View Source Code Vote up 5 votes
private Widget createPanel() {
	String comboWidth = "150px";

	vectorFormatCombo = new VectorFormatComboBox(comboWidth,
			VectorFormat.getSupportedExportVectorFormat());
	vectorFormatCombo.addSelectionHandler(getVectorComboSelectionHandler());
	vectorFormatCombo.setValue(VectorFormat.GEO_JSON_FORMAT);
	epsgCombo = new ProjectionComboBox(comboWidth);
	
	
	downloadFileButton = new TextButton(
			UIMessages.INSTANCE.downloadfileText());
	downloadFileButton.setIcon(ImageProvider.INSTANCE.download32());
	downloadFileButton.setIconAlign(IconAlign.TOP);
	
	gitHubButton = new TextButton(
			"GitHub");
	gitHubButton.setIcon(ImageProvider.INSTANCE.github32());
	gitHubButton.setIconAlign(IconAlign.TOP);

	HorizontalPanel horizontalGroup = new HorizontalPanel();
	horizontalGroup.getElement().getStyle().setBackgroundColor("#E0ECF8");
	horizontalGroup.setSpacing(10);

	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setSpacing(5);
	vPanel.add(vectorFormatCombo);
	vPanel.add(epsgCombo);

	horizontalGroup.add(vPanel);
					
	horizontalGroup.add(downloadFileButton);
	horizontalGroup.add(gitHubButton);
	
	return horizontalGroup;
}
 
Example 27
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 28
Project: appinventor-extensions   File: Ode.java   View Source Code Vote up 5 votes
/**
 * Possibly display the MIT App Inventor "Splash Screen"
 *
 * @param force Bypass the check to see if they have dimissed this version
 */
private void createWelcomeDialog(boolean force) {
  if (!shouldShowWelcomeDialog() && !force) {
    maybeShowNoProjectsDialog();
    return;
  }
  // Create the UI elements of the DialogBox
  final DialogBox dialogBox = new DialogBox(false, true); // DialogBox(autohide, modal)
  dialogBox.setStylePrimaryName("ode-DialogBox");
  dialogBox.setText(MESSAGES.createWelcomeDialogText());
  dialogBox.setHeight(splashConfig.height + "px");
  dialogBox.setWidth(splashConfig.width + "px");
  dialogBox.setGlassEnabled(true);
  dialogBox.setAnimationEnabled(true);
  dialogBox.center();
  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(splashConfig.content);
  message.setStyleName("DialogBox-message");
  FlowPanel holder = new FlowPanel();
  Button ok = new Button(MESSAGES.createWelcomeDialogButton());
  final CheckBox noshow = new CheckBox(MESSAGES.doNotShow());
  ok.addClickListener(new ClickListener() {
      public void onClick(Widget sender) {
        dialogBox.hide();
        if (noshow.getValue()) { // User checked the box
          userSettings.getSettings(SettingsConstants.SPLASH_SETTINGS).
            changePropertyValue(SettingsConstants.SPLASH_SETTINGS_VERSION,
              "" + splashConfig.version);
          userSettings.saveSettings(null);
        }
        maybeShowNoProjectsDialog();
      }
    });
  holder.add(ok);
  holder.add(noshow);
  DialogBoxContents.add(message);
  DialogBoxContents.add(holder);
  dialogBox.setWidget(DialogBoxContents);
  dialogBox.show();
}
 
Example 29
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 30
Project: appinventor-extensions   File: MotdUi.java   View Source Code Vote up 5 votes
/**
 * Creates a new output panel for MOTD.
 */
private MotdUi() {
  // Initialize UI
  text = new HTML();
  text.setSize("100%", "100%");
  text.setStylePrimaryName("ode-Motd");

  panel = new VerticalPanel();
  panel.add(text);
  panel.setSize("100%", "100%");
  panel.setCellHeight(text, "100%");
  panel.setCellWidth(text, "100%");

  initWidget(panel);
}
 
Example 31
Project: document-management-system   File: MenuPopup.java   View Source Code Vote up 5 votes
public MenuPopup() {
	// Establishes auto-close when click outside
	super(true, true);
	panel = new VerticalPanel();
	menu = new Menu();
	panel.add(menu);
	setWidget(panel);
}
 
Example 32
Project: document-management-system   File: MenuPopup.java   View Source Code Vote up 5 votes
public MenuPopup() {
	// Establishes auto-close when click outside
	super(true, true);
	panel = new VerticalPanel();
	menu = new Menu();
	panel.add(menu);
	setWidget(panel);
}
 
Example 33
Project: LAS   File: LatLonWidget.java   View Source Code Vote up 5 votes
/**
	 * Constructs an empty widget.
	 */
	public LatLonWidget() {
		panel = new Grid(1,3);
		middle = new VerticalPanel();
		
		rose = new Image(GWT.getModuleBaseURL()+"../images/compass_rose.png");
		rose.addStyleName("OL_MAP-middle");

		southLat = new TextBox();
		northLat = new TextBox();

		southLat.setWidth(boxWidth);
		northLat.setWidth(boxWidth);

		eastLon = new TextBox();
		westLon = new TextBox();

		eastLon.setWidth(boxWidth);
		westLon.setWidth(boxWidth);
        
		panel.setWidget(0, 0, westLon);	
		middle.add(northLat);
		middle.add(rose);
		middle.add(southLat);
		panel.setWidget(0, 1, middle);
		panel.setWidget(0, 2, eastLon);
//		panel.getFlexCellFormatter().setColSpan(2, 0, 2);
		
		initWidget(panel);
	}
 
Example 34
Project: document-management-system   File: TabWorkspaceExample.java   View Source Code Vote up 5 votes
/**
 * TabWorkspaceExample
 */
public TabWorkspaceExample() {
	vPanel = new VerticalPanel();
	vPanel.add(new HTML("new workspace example"));
	vPanel.setStyleName("okm-Input");

	initWidget(vPanel);
}
 
Example 35
Project: document-management-system   File: TabDocumentStapling.java   View Source Code Vote up 5 votes
public TabDocumentStapling() {
	title = GeneralComunicator.i18nExtension("stapling.tab.document.title");

	vPanel = new VerticalPanel();
	scrollPanel = new ScrollPanel(vPanel);
	table = new FlexTable();
	vPanel.add(table);


	initWidget(scrollPanel);
}
 
Example 36
Project: document-management-system   File: TabMailStapling.java   View Source Code Vote up 5 votes
public TabMailStapling() {
	title = GeneralComunicator.i18nExtension("stapling.tab.mail.title");

	vPanel = new VerticalPanel();
	scrollPanel = new ScrollPanel(vPanel);
	table = new FlexTable();
	vPanel.add(table);


	initWidget(scrollPanel);
}
 
Example 37
Project: document-management-system   File: UserDashboard.java   View Source Code Vote up 5 votes
/**
 * UserDashboard
 */
public UserDashboard() {
	vPanelLeft = new VerticalPanel();
	vPanelRight = new VerticalPanel();
	hPanel = new HorizontalPanel();

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

	lockedDocuments = new DashboardWidget("UserLockedDocuments", "dashboard.user.locked.documents",
			"img/icon/lock.gif", true, "userLockedDocuments");
	chechoutDocuments = new DashboardWidget("UserCheckedOutDocuments", "dashboard.user.checkout.documents",
			"img/icon/actions/checkout.gif", true, "userCheckedOutDocuments");
	lastModifiedDocuments = new DashboardWidget("UserLastModifiedDocuments",
			"dashboard.user.last.modified.documents", "img/icon/actions/checkin.gif", true,
			"userLastModifiedDocuments");
	lastDownloadedDocuments = new DashboardWidget("UserLastDownloadedDocuments",
			"dashboard.user.last.downloaded.documents", "img/icon/actions/download.gif", false,
			"userLastDownloadedDocuments");
	subscribedDocuments = new DashboardWidget("UserSubscribedDocuments", "dashboard.user.subscribed.documents",
			"img/icon/subscribed.gif", false, "userSubscribedDocuments");
	subscribedFolder = new DashboardWidget("UserSubscribedFolders", "dashboard.user.subscribed.folders",
			"img/icon/subscribed.gif", false, "userSubscribedFolders");
	lastUploadedDocuments = new DashboardWidget("UserLastUploadedDocuments",
			"dashboard.user.last.uploaded.documents", "img/icon/actions/add_document.gif", true,
			"userLastUploadedDocuments");

	vPanelLeft.add(lockedDocuments);
	vPanelLeft.add(chechoutDocuments);
	vPanelLeft.add(lastDownloadedDocuments);
	vPanelRight.add(lastModifiedDocuments);
	vPanelRight.add(lastUploadedDocuments);
	vPanelLeft.add(subscribedDocuments);
	vPanelLeft.add(subscribedFolder);

	initWidget(hPanel);
}
 
Example 38
Project: document-management-system   File: AttachmentMenuPopup.java   View Source Code Vote up 5 votes
public AttachmentMenuPopup() {
	// Establishes auto-close when click outside
	super(true, true);
	panel = new VerticalPanel();
	menu = new Menu();
	panel.add(menu);
	setWidget(panel);
}
 
Example 39
Project: document-management-system   File: FilePath.java   View Source Code Vote up 5 votes
/**
 * FilePath
 */
public FilePath() {
	panel = new VerticalPanel();
	path = new HTML(Main.i18n("filebrowser.path") + ": ", false);
	panel.setStyleName("okm-FilePath-Title");
	panel.setSize("100%", "22px");
	panel.add(path);
	panel.setCellVerticalAlignment(path, VerticalPanel.ALIGN_MIDDLE);
	initWidget(panel);

	// Only executes first time when object is created to initalize values
	getRootPath();
}
 
Example 40
Project: document-management-system   File: MenuPopup.java   View Source Code Vote up 5 votes
public MenuPopup() {
	// Establishes auto-close when click outside
	super(true, true);
	panel = new VerticalPanel();
	menu = new Menu();
	panel.add(menu);
	setWidget(panel);
}
 
Example 41
Project: fullmetalgalaxy   File: WgtMessages.java   View Source Code Vote up 5 votes
/**
 * init widget to edit main game message
 * @param p_text
 */
private void initEditableMsg(VerticalPanel p_panel, String p_text)
{
  p_panel.clear();
  p_panel.add( m_text );
  m_text.setPixelSize( 400, 350 );
  m_text.setText( p_text );
  m_text.addBlurHandler( this );
}
 
Example 42
Project: onecmdb   File: DragablePopup.java   View Source Code Vote up 5 votes
public void load() {
	VerticalPanel panel = new VerticalPanel();
	HorizontalPanel header = new HorizontalPanel();
	header.setStyleName("one-select-popup-header");
	header.setWidth("100%");
	Label headerLabel = new Label(title);
	Image close = new Image("images/eclipse/close.gif");
	header.add(headerLabel);
	header.add(close);
	
	header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT);
	header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT);
	header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE);
	
	// Add drag control.
	new DragControl(this, headerLabel);
	
	close.addClickListener(new ClickListener() {
		public void onClick(Widget sender) {
			hide();	
		}
	});
	panel.add(header);
	panel.add(content);
	
	panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP);
	panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP);
	panel.setCellHeight(content, "100%");
	setWidget(panel);
}
 
Example 43
Project: appformer   File: Dialog.java   View Source Code Vote up 5 votes
public Dialog() {
    VerticalPanel panel = new VerticalPanel();
    dialogArea = createDialogArea();
    panel.add(dialogArea);
    panel.add(createButtonBar());
    setWidget(panel);
}
 
Example 44
Project: teiid-webui   File: TablesProcNamesTable.java   View Source Code Vote up 5 votes
/**
 * Create the panel
 * @return the panel widget
 */
protected Widget createTablePanel() {
	table = new SimpleTable<String>(TABLE_HEIGHT_PX,TABLE_WIDTH_PX,TABLE_VISIBLE_ROWS);
    TextColumn<String> nameColumn = new TextColumn<String>() {
        public String getValue( String row ) {
            return row;
        }
    };
    table.addColumn( nameColumn, COLUMN_HEADER_NAME );
    table.setColumnWidth(nameColumn, 200, Unit.PX);
    
    VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.add(table);
    return verticalPanel;
}
 
Example 45
Project: geowe-core   File: AttributeSearchDialog.java   View Source Code Vote up 5 votes
private Widget createPanel() {

		VerticalPanel vPanel = new VerticalPanel();
		vPanel.setPixelSize(490, 420);
		vPanel.setSpacing(5);
		vPanel.add(createTopPanel());
		vPanel.add(createBottomPanel());

		return vPanel;
	}
 
Example 46
Project: firefly   File: NaifTargetPanel.java   View Source Code Vote up 5 votes
private Widget getHelp() {
        HorizontalPanel hp= new HorizontalPanel();
        VerticalPanel vp= new VerticalPanel();
        hp.setSpacing(5);
//        vp.setSpacing(5);

        hp.add(new HTML("<i>Examples:</i>"));
        hp.add(vp);
        vp.add(new HTML("\'pallas\'&nbsp;&nbsp;&nbsp; \'2008 yn2\'&nbsp;&nbsp;&nbsp; \'2024703\'" ));
//        vp.add(new HTML(""));

        return GwtUtil.centerAlign(hp);
    }
 
Example 47
Project: x-cure-chat   File: Top10UserFileWidget.java   View Source Code Vote up 5 votes
/**
 * The basic constructor
 * @param parentDialog the reference to the parent dialog or null if none
 * @param fileDescriptors the list of the users' profile files to browse through 
 * @param fileIndex the index of the file we create this preview widget for
 */
public Top10UserFileWidget( final DialogBox parentDialog, final List<ShortUserFileDescriptor> fileDescriptors, final int fileIndex ) {
	//Store the data
	this.parentDialog = parentDialog;
	this.fileDescr = fileDescriptors.get( fileIndex );
	
	//Initialize and fill out the main panel
	mainPanel = new VerticalPanel();
	mainPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER );
	
	//Initialize the image 
	previewImage = constructThumbnailImage( fileDescriptors, fileIndex );
	
	//Initialize the upload date panel
	final HorizontalPanel uploadDatePanel = new HorizontalPanel();
	uploadDatePanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM );
	//Add the image
	uploadDatePanel.add( new Image( ServerSideAccessManager.USER_INFO_RELATED_IMAGES_LOCATION +
			  			 ServerSideAccessManager.SERVER_CONTEXT_DELIMITER + "uploaded.png" ) );
	uploadDatePanel.add( new HTML("&nbsp;") );
	//Add the date label
	{
		final DateTimeFormat dateTimeFormat = DateTimeFormat.getFormat( PredefinedFormat.DATE_TIME_SHORT );
		final Label uploadDateLabel = new Label( dateTimeFormat.format( fileDescr.uploadDate ) );
		uploadDateLabel.setStyleName( CommonResourcesContainer.TOP_TEN_USER_FILE_UPLOAD_DATE_STYLE );
		uploadDatePanel.add( uploadDateLabel );
	}
	
	//Initialize the user name label
	userNameAvatar = new UserAvatarWidget( fileDescr.ownerID, fileDescr.ownerLoginName );
	
	mainPanel.add( previewImage );
	mainPanel.add( uploadDatePanel );
	mainPanel.add( userNameAvatar );
	
	//Initialize the composite
	initWidget(mainPanel);
}
 
Example 48
Project: firefly   File: RangePanel.java   View Source Code Vote up 5 votes
private void init() {
    mainPanel = new VerticalPanel();
    mainPanel.add(new HTML(title));

    fp = new FilterPanel(colList, false);
    mainPanel.add(fp);
    mainPanel.setSpacing(4);
}
 
Example 49
Project: easy-vote   File: VoteConfirmationWidget.java   View Source Code Vote up 5 votes
public VoteConfirmationWidget(int chosenPosition, EasyVoteAsyncCallback<Void> cb) {
	
	super(false, true);
	setText("Confirmation Window");
	setAnimationEnabled(true);
	
	this.chosenPosition = chosenPosition;
	this.cb = cb;
	
	mainPanel = new VerticalPanel();
	buttonPanel = new HorizontalPanel();
	
	if(chosenPosition != -1) {
		mainPanel.add(new HTML("Are you sure you want to cast this vote?"));
	} else {
		mainPanel.add(new HTML("Are you sure you want to cast a blank vote?"));
	}
	
	confirmationButton = new Button("Yes");
	confirmationButton.addStyleName("BallotWidget-submitVoteButton");
	confirmationButton.addClickHandler(new ConfirmationHandler());
	buttonPanel.add(confirmationButton);
	
	closeButton = new Button("No");
	closeButton.addStyleName("BallotWidget-submitVoteButton");
	closeButton.addClickHandler(new CloseHandler());
	buttonPanel.add(closeButton);
	
	mainPanel.add(buttonPanel);
	
	setWidget(mainPanel);
}
 
Example 50
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 51
Project: sig-seguimiento-vehiculos   File: SaveProjectDialog.java   View Source Code Vote up 4 votes
private HorizontalLayoutContainer createTopPanel() {
	String fieldWidth = "225px";
	VerticalPanel infoPanel = new VerticalPanel();
	infoPanel.setSpacing(5);

	projectNameField = new TextField();		
	projectNameField.setEnabled(true);
	projectNameField.setWidth(fieldWidth);
	infoPanel.add(new Label(UIMessages.INSTANCE.projectFileName()));
	infoPanel.add(projectNameField);
	
	projectTitleField = new TextField();
	projectTitleField.setEnabled(true);
	projectTitleField.setWidth("280px");
	infoPanel.add(new Label(UIMessages.INSTANCE.projectTitle()));
	infoPanel.add(projectTitleField);
	
	projectVersionField = new TextField();
	projectVersionField.setValue(PROJECT_VERSION);
	projectVersionField.setEnabled(false);
	projectVersionField.setWidth("125px");
	infoPanel.add(new Label(UIMessages.INSTANCE.projectVersion()));
	infoPanel.add(projectVersionField);
	
	vectorLayerCountField = new TextField();		
	vectorLayerCountField.setEnabled(false);
	vectorLayerCountField.setWidth("125px");
	infoPanel.add(new Label(UIMessages.INSTANCE.projectTotalVectorLayer()));
	infoPanel.add(vectorLayerCountField);
			
	projectDescriptionField = new TextArea();
	projectDescriptionField.setEnabled(true);
	projectDescriptionField.setWidth("280px");
	
	
	infoPanel.add(new Label(UIMessages.INSTANCE.projectDescription()));
	infoPanel.add(projectDescriptionField);
	
	HorizontalLayoutContainer hPanel = new HorizontalLayoutContainer();

	hPanel.add(infoPanel);

	return hPanel;
}
 
Example 52
Project: optashift-employee-rostering   File: TwoDayView.java   View Source Code Vote up 4 votes
private void initPanels() {
    pagination = new Pagination();
    pager = new SimplePager();

    VerticalPanel bottomWidgets = new VerticalPanel();

    startDateControlScrollbar = new NativeHorizontalScrollbar();
    startDateControlScrollbar.setWidth("100%");
    startDateControlScrollbar.addScrollHandler((e) -> {
        double pos = (startDateControlScrollbar.getHorizontalScrollPosition()
                + 0.0) /
                (startDateControlScrollbar.getScrollWidth());
        long secondsBetween = presenter.getHardEndDateBound().toEpochSecond(ZoneOffset.UTC) - presenter
                .getHardStartDateBound()
                .toEpochSecond(ZoneOffset.UTC);
        presenter.setToolBox(null);
        presenter.getCalendar().setDate(presenter.getHardStartDateBound().plusSeconds(Math.round(secondsBetween
                * pos)));
    });

    daysShownRangeSlider = RangeSlider.create();
    daysShownRangeSlider.setMin("1");
    daysShownRangeSlider.setMax("7");
    daysShownRangeSlider.setStep("1");
    daysShownRangeSlider.setAttribute("orient", "vertical");
    CssResources.INSTANCE.calendar().ensureInjected();
    daysShownRangeSlider.setClassName(CssResources.INSTANCE.calendar().verticalSlider());
    daysShownRangeSlider.setValue(Integer.toString(presenter.getDaysShown()));
    Event.setEventListener(daysShownRangeSlider, (e) -> {
        presenter.getCalendar().setDaysShown(Integer
                .parseInt(daysShownRangeSlider.getValue()));
    });
    //Work around for there not being a Event.ONINPUT
    Event.sinkEvents(daysShownRangeSlider, ~0);
    daysShownRangeSliderContainer = new Span();
    daysShownRangeSliderContainer.getElement().appendChild(daysShownRangeSlider);
    sidePanel.add(daysShownRangeSliderContainer);

    bottomWidgets.add(startDateControlScrollbar);

    bottomWidgets.add(pagination);

    bottomPanel.add(bottomWidgets);

    pager.setDisplay(presenter.getPager());
    pager.setPageSize(presenter.getTotalDisplayedSpotSlots());
    pagination.clear();
}
 
Example 53
Project: appinventor-extensions   File: RemixedYoungAndroidProjectWizard.java   View Source Code Vote up 4 votes
/**
 * Creates a new YoungAndroid project wizard.
 */
public RemixedYoungAndroidProjectWizard(final GalleryApp app, final Button actionButton) {
  super(MESSAGES.remixedYoungAndroidProjectWizardCaption());

  this.actionButton = actionButton;
  gallery = GalleryClient.getInstance();
  // Initialize the UI
  setStylePrimaryName("ode-DialogBox");

  projectNameTextBox = new LabeledTextBox(MESSAGES.projectNameLabel());
  projectNameTextBox.setText(replaceNonTextChar(app.getTitle()));
  projectNameTextBox.getTextBox().addKeyDownHandler(new KeyDownHandler() {
    @Override
    public void onKeyDown(KeyDownEvent event) {
      int keyCode = event.getNativeKeyCode();
      if (keyCode == KeyCodes.KEY_ENTER) {
        handleOkClick();
      } else if (keyCode == KeyCodes.KEY_ESCAPE) {
        handleCancelClick();
      }
    }
  });

  VerticalPanel page = new VerticalPanel();
  page.add(projectNameTextBox);
  addPage(page);
  // Create finish command (create a new Young Android project)
  initFinishCommand(new Command() {
    @Override
    public void execute() {
      String projectName = projectNameTextBox.getText();
      final PopupPanel popup = new PopupPanel(true);
      final FlowPanel content = new FlowPanel();
      popup.setWidget(content);
      Label loading = new Label();
      loading.setText(MESSAGES.loadingAppIndicatorText());
      // loading indicator will be hided or forced to be hided in gallery.loadSourceFile
      content.add(loading);
      popup.center();
      boolean success = gallery.loadSourceFile(app, projectNameTextBox.getText(), popup);
      if(success){
        gallery.appWasDownloaded(app.getGalleryAppId(), app.getDeveloperId());
      }
      else {
        show();
        center();
        return;
      }
    }
  });
}
 
Example 54
Project: appinventor-extensions   File: ComponentUploadWizard.java   View Source Code Vote up 4 votes
public ComponentUploadWizard() {
  super(MESSAGES.componentUploadWizardCaption(), true, false);

  final FileUpload uploadWiget = new FileUpload();
  uploadWiget.setName(ServerLayout.UPLOAD_COMPONENT_ARCHIVE_FORM_ELEMENT);

  VerticalPanel panel = new VerticalPanel();
  panel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
  panel.add(uploadWiget);

  addPage(panel);

  setStylePrimaryName("ode-DialogBox");

  initFinishCommand(new Command() {
    @Override
    public void execute() {
      if (!uploadWiget.getFilename().endsWith(COMPONENT_ARCHIVE_EXTENSION)) {
        Window.alert(MESSAGES.notComponentArchiveError());
        return;
      }

      String url = GWT.getModuleBaseURL() +
        ServerLayout.UPLOAD_SERVLET + "/" +
        ServerLayout.UPLOAD_COMPONENT + "/" +
        trimLeadingPath(uploadWiget.getFilename());

      Uploader.getInstance().upload(uploadWiget, url,
        new OdeAsyncCallback<UploadResponse>() {
          @Override
          public void onSuccess(UploadResponse uploadResponse) {
            Component component = Component.valueOf(uploadResponse.getInfo());
            ErrorReporter.reportInfo("Uploaded successfully");
          }
        });
    }

    private String trimLeadingPath(String filename) {
      // Strip leading path off filename.
      // We need to support both Unix ('/') and Windows ('\\') separators.
      return filename.substring(Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\')) + 1);
    }
  });
}
 
Example 55
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 56
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 57
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 58
Project: firefly   File: FitsDownloadOpsDialog.java   View Source Code Vote up 4 votes
private void createContents() {
    WebPlot plot= _pv.getPrimaryPlot();


    EnumFieldDef typeFD= (EnumFieldDef)FieldDefCreator.makeFieldDef(_prop.makeBase("dType"));
    if (_pv.getUserDrawerLayerSet().size()==0) {
        typeFD.removeItem("region");
    }
    _dType= SimpleInputField.createByDef(typeFD, new SimpleInputField.Config("75px"));

    VerticalPanel panel= new VerticalPanel();
    panel.add(_dType);
    _dType.getField().addValueChangeHandler(new ValueChangeHandler<String>() {
        public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
            updateOptionsVisible();
        }
    });

    if (plot.isThreeColor()) {
        EnumFieldDef fd= new EnumFieldDef();
        fd.setMask("[RADIO]");
        fd.setName("FitsDownloadOpsDialog.whichColor");
        fd.setMaxWidth(100);
        fd.setOrientation(EnumFieldDef.Orientation.Vertical);
        fd.setLabel(_prop.getName("cband"));
        boolean first= true;
        for(Band band : plot.getBands()) {
            fd.addItem(band.toString(), band.toString());
            if (first)  {
                fd.setDefaultValue(band.toString());
                first= false;
            }

        }
        _bandSelect= SimpleInputField.createByDef(fd, new SimpleInputField.Config("75px"));
        panel.add(_bandSelect);
    }


    PlotState state= plot.getPlotState();

    _showWhichOp = state.hasOperation(PlotState.Operation.CROP) && !state.hasOperation(PlotState.Operation.ROTATE);
    _whichOp= SimpleInputField.createByProp(_prop.makeBase("whichOp"), new SimpleInputField.Config("75px"));
    panel.add(_whichOp);
    _whichOp.setVisible(_showWhichOp);



    _topPanel.add(panel);
    updateOptionsVisible();
}
 
Example 59
Project: geowe-core   File: AttributeSearchDialog.java   View Source Code Vote up 4 votes
private HorizontalLayoutContainer createTopPanel() {
	
	HorizontalLayoutContainer hPanel = new HorizontalLayoutContainer();

	VerticalPanel infoPanel = new VerticalPanel();
	infoPanel.setSpacing(5);

	layerNameField = new TextField();
	layerNameField.setEnabled(false);
	layerNameField.setWidth(FIELD_WIDTH);
	infoPanel.add(new Label(UIMessages.INSTANCE.asdLayerNameLabel()));
	infoPanel.add(layerNameField);


	infoPanel.add(createAttrPanel());
	infoPanel.add(createSearchButtonPanel());

	hPanel.add(infoPanel);

	return hPanel;
}
 
Example 60
Project: firefly   File: ZoomOptionsPopup.java   View Source Code Vote up 3 votes
private void layout(String message,boolean atMax) {

        VerticalPanel vbox= new VerticalPanel();
        vbox.setSpacing(5);

        setMessage(message);
        vbox.add(_messageLabel);

        _levelBox.setSpacing(3);
        updateLevels(atMax);

        vbox.add(GwtUtil.centerAlign(_levelBox));

        _popup.setWidget(GwtUtil.centerAlign(vbox));
    }