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

The following examples show how to use com.google.gwt.user.client.ui.VerticalPanel#clear() . 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: YoungAndroidPalettePanel.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
public void clearComponentsExceptExtension() {
  for (ComponentCategory category : categoryPanels.keySet()) {
    if (!ComponentCategory.EXTENSION.equals(category)) {
      VerticalPanel panel = categoryPanels.get(category);
      panel.clear();
      stackPalette.remove(panel);
    }
  }
  for (PaletteHelper pal : paletteHelpers.values()) {
    pal.clear();
  }
  categoryPanels.clear();
  paletteHelpers.clear();
  categoryOrder.clear();
  simplePaletteItems.clear();
}
 
Example 2
Source File: YoungAndroidPalettePanel.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
@Override
public void clearComponents() {
  for (ComponentCategory category : categoryPanels.keySet()) {
    VerticalPanel panel = categoryPanels.get(category);
    panel.clear();
    stackPalette.remove(panel);
  }
  for (PaletteHelper pal : paletteHelpers.values()) {
    pal.clear();
  }
  categoryPanels.clear();
  paletteHelpers.clear();
  categoryOrder.clear();
  simplePaletteItems.clear();
}
 
Example 3
Source File: RBACContextView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Widget asWidget() {
    VerticalPanel container = new VerticalPanel();
    container.setStyleName("fill-layout");

    HorizontalPanel menu = new HorizontalPanel();
    menu.setStyleName("fill-layout-width");
    final TextBox nameBox = new TextBox();
    nameBox.setText(securityFramework.resolveToken());

    MultiWordSuggestOracle oracle = new  MultiWordSuggestOracle();
    oracle.addAll(Console.MODULES.getRequiredResourcesRegistry().getTokens());

    SuggestBox suggestBox = new SuggestBox(oracle, nameBox);

    Button btn = new Button("Show", new ClickHandler() {
        @Override
        public void onClick(ClickEvent clickEvent) {
            container.clear();

            try {
                container.add(createContent(nameBox.getText()));
            } catch (Throwable e) {
                HTML msg = new HTML(e.getMessage());
                msg.getElement().getStyle().setColor("red");
                container.add(msg);
            }
        }
    });
    menu.add(new HTML("Token: "));
    menu.add(suggestBox);
    menu.add(btn);


    VerticalPanel p = new VerticalPanel();
    p.setStyleName("fill-layout-width");
    p.add(menu);
    p.add(container);
    return p;
}
 
Example 4
Source File: PreviewFileCommand.java    From appinventor-extensions with Apache License 2.0 4 votes vote down vote up
@Override
public void execute(final ProjectNode node) {
  final DialogBox dialogBox = new DialogBox();
  dialogBox.setText(node.getName());
  dialogBox.setStylePrimaryName("ode-DialogBox");

  //setting position of dialog box
  dialogBox.center();
  dialogBox.setAnimationEnabled(true);

  //button element
  final Button closeButton = new Button(MESSAGES.closeFilePreview());
  closeButton.getElement().setId("closeButton");
  closeButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        dialogBox.hide();
      }
    });

  HorizontalPanel buttonPanel = new HorizontalPanel();
  buttonPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
  buttonPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
  buttonPanel.add(closeButton);

  VerticalPanel dialogPanel = new VerticalPanel();
  dialogPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
  dialogPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);

  Widget filePreview = generateFilePreview(node);
  dialogPanel.clear();
  dialogPanel.add(filePreview);

  dialogPanel.add(buttonPanel);
  dialogPanel.setWidth("300px");

  dialogBox.setGlassEnabled(false);
  dialogBox.setModal(false);

  // Set the contents of the Widget
  dialogBox.setWidget(dialogPanel);
  dialogBox.center();
  dialogBox.show();
}