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

The following examples show how to use com.google.gwt.user.client.ui.SimplePanel#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SaveDatasetPanel.java    From EasyML with Apache License 2.0 6 votes vote down vote up
@Override
protected void init(){
	grid = new DescribeGrid(labarr, "data");
	verticalPanel.add(grid);
	grid.addStyleName("bda-descgrid-savedata");
	savebtn.setStyleName("bda-descgrid-savedata-submitbtn");
	SimplePanel simPanel = new SimplePanel();
	simPanel.add( savebtn );
	simPanel.setStyleName("bda-descgrid-savedata-simpanel");
	verticalPanel.add(simPanel);
	savebtn.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid);
		}
	});
}
 
Example 2
Source File: TemplateUploadWizard.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
public TemplateWidget(TemplateInfo info, String hostUrl) {
  setTemplate(info, hostUrl);

  panel = new VerticalPanel();
  panel.add(title);
  title.getElement().getStyle().setFontWeight(Style.FontWeight.BOLD);
  panel.add(subtitle);
  descriptionHtml.setHTML(info.description);
  panel.add(descriptionHtml);
  panel.add(image);
  SimplePanel wrapper = new SimplePanel();
  wrapper.getElement().getStyle().setOverflowY(Style.Overflow.SCROLL);
  wrapper.add(panel);
  initWidget(wrapper);
  setStylePrimaryName("ode-ContextMenu");
  setHeight("355px");
}
 
Example 3
Source File: WeekGrid.java    From calendar-component with Apache License 2.0 5 votes vote down vote up
public WeekGrid(VCalendar parent, boolean format24h) {
    setCalendar(parent);
    content = new HorizontalPanel();
    timebar = new Timebar(format24h);
    content.add(timebar);

    wrapper = new SimplePanel();
    wrapper.setStylePrimaryName("v-calendar-week-wrapper");
    wrapper.add(content);

    setWidget(wrapper);
}
 
Example 4
Source File: TopToolbar.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
@Override
public void execute() {
  final DialogBox db = new DialogBox(false, true);
  db.setText("About The Companion");
  db.setStyleName("ode-DialogBox");
  db.setHeight("200px");
  db.setWidth("400px");
  db.setGlassEnabled(true);
  db.setAnimationEnabled(true);
  db.center();

  String downloadinfo = "";
  if (!YaVersion.COMPANION_UPDATE_URL1.equals("")) {
    String url = "http://" + Window.Location.getHost() + YaVersion.COMPANION_UPDATE_URL1;
    downloadinfo = "<br/>\n<a href=" + url + ">Download URL: " + url + "</a><br/>\n";
    downloadinfo += BlocklyPanel.getQRCode(url);
  }

  VerticalPanel DialogBoxContents = new VerticalPanel();
  HTML message = new HTML(
      "Companion Version " + BlocklyPanel.getCompVersion() + downloadinfo
  );

  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 5
Source File: MockListView.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
private void createLabelPanel() {
  panelForItem =new SimplePanel();
  panelForItem.setStylePrimaryName("listViewItemStyle");
  panelForItem.setSize(ComponentConstants.LISTVIEW_PREFERRED_WIDTH + "px",
      ComponentConstants.LISTVIEW_PREFERRED_HEIGHT + "px");
  panelForItem.add(labelInItem);
  listViewWidget.add(panelForItem);
}
 
Example 6
Source File: MockFeatureCollection.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
public MockFeatureCollection(SimpleEditor editor) {
  super(editor, TYPE, images.featurecollection(), new MockFeatureCollectionLayout());

  SimplePanel panel = new SimplePanel();
  panel.setWidth("16px");
  panel.setHeight("16px");
  panel.setStylePrimaryName("ode-SimpleMockComponent");
  Image icon = new Image(images.featurecollection());
  panel.add(icon);

  initComponent(panel);
  initCollection();
  initialized = true;
}
 
Example 7
Source File: SearchResult.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
public SearchResult() {
	sp = new SimplePanel();
	searchCompactResult = new SearchCompactResult();
	searchFullResult = new SearchFullResult();
	sp.add(searchFullResult);

	status = new Status();
	status.setStyleName("okm-StatusPopup");

	initWidget(sp);
}
 
Example 8
Source File: WordCloudDetailApp.java    From swcv with MIT License 5 votes vote down vote up
private SimplePanel createPanel(String svg, int width, int height)
{
    SimplePanel panel = new SimplePanel();
    panel.setPixelSize(width, height);
    panel.addStyleName("center");
    HTML html = new HTML(svg);
    html.setWidth("100%");
    html.setHeight("100%");
    panel.add(html);
    return panel;
}
 
Example 9
Source File: MonitorView.java    From EasyML with Apache License 2.0 4 votes vote down vote up
@Override
public Widget createMainLayout() {
	SplitLayoutPanel splitLayout = new SplitLayoutPanel();


	StackLayoutPanel stack = new StackLayoutPanel(Unit.EM);
	stack.setStyleName("sp");
	ScrollPanel leftcrp = new ScrollPanel();
	leftcrp.setSize("100%", "100%");
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setWidth("100%");

	programTree = ProgramTreeLoader.load(AppController.email);
	datasetTree = DatasetTreeLoader.load(AppController.email);
	jobTree = JobTreeLoader.load(AppController.email);
	resultTree = new SearchTree();
	initTabPanel();
	DisclosurePanel distackleft = new DisclosureStackPanel("Search")
	.asWidget();
	searchGrid = new SearchGrid(programTree,datasetTree,jobTree,resultTree);
	distackleft.setContent(searchGrid);
	SimplePanel tabSimPanel = new SimplePanel();
	tabSimPanel.add(tabPanel);

	vPanel.add(tabSimPanel);
	vPanel.add(distackleft);
	leftcrp.add(vPanel);
	stack.add(leftcrp, "", 0);

	StackLayoutPanel stackright = new StackLayoutPanel(Unit.EM);
	stackright.setStyleName("sp");
	DisclosurePanel distackright1 = new DisclosureStackPanel(Constants.studioUIMsg.jobPanelTitle())
	.asWidget();
	DisclosurePanel distackright2 = new DisclosureStackPanel(Constants.studioUIMsg.modulePanelTitle())
	.asWidget();
	ScrollPanel scvp = new ScrollPanel();
	VerticalPanel verticalPanel = new VerticalPanel();
	verticalPanel.setWidth("100%");

	HorizontalPanel btnPanel = new HorizontalPanel();
	historyBtn.removeStyleName("gwt-Button");
	historyBtn.addStyleName("history-button-style");
	submitBtn.setEnabled( false );
	submitBtn.removeStyleName("gwt-Button");
	submitBtn.addStyleName("button-style");
	clearBtn.removeStyleName("gwt-Button");
	clearBtn.addStyleName("button-style");
	cloneBtn.removeStyleName("gwt-Button");
	cloneBtn.addStyleName("button-style");
	refreshBtn.removeStyleName("gwt-Button");
	refreshBtn.addStyleName("button-style");
	stopBtn.removeStyleName("gwt-Button");
	stopBtn.addStyleName("button-style");

	btnPanel.add(historyBtn);
	btnPanel.add(new HTML("&nbsp;&nbsp;"));
	btnPanel.add(submitBtn);
	btnPanel.add(new HTML("&nbsp;&nbsp;"));
	btnPanel.add(clearBtn);
	btnPanel.add(new HTML("&nbsp;&nbsp;"));
	btnPanel.add(cloneBtn);
	btnPanel.add(new HTML("&nbsp;&nbsp;"));
	btnPanel.add(stopBtn);
	btnPanel.add(new HTML("&nbsp;&nbsp;"));
	btnPanel.add(refreshBtn);


	btnPanel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	btnPanel2.add(btnPanel);
	btnPanel2.addStyleName("btnPanel");

	splitLayout.addWest(stack, 200);

	jobDescGrid = new MonitorJobDescGrid();

	distackright1.setContent(jobDescGrid);
	distackright2.setContent(propPanel);
	verticalPanel.add(distackright1);
	verticalPanel.add(distackright2);
	scvp.add(verticalPanel);
	stackright.add(scvp, "", 0);
	splitLayout.addEast(stackright, 287);

	// Use different controllers in different classes
	setController(new MonitorController(Constants.CONTROLLER_WIDTH,
			Constants.CONTROLLER_HEIGHT));
	rebuiltLayoutPanel(getController());
	splitLayout.add(layoutPanel);

	return splitLayout;
}
 
Example 10
Source File: TopToolbar.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@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/>" + MESSAGES.useCompanion(YaVersion.PREFERRED_COMPANION, YaVersion.PREFERRED_COMPANION + "u") +
      "<BR/>" + MESSAGES.targetSdkVersion(YaVersion.TARGET_SDK_VERSION, YaVersion.TARGET_ANDROID_VERSION);
  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();
}