예제 #1
0
  private void addActionMenu() {
    Button button = new Button("Action");
    Menu menu = new Menu();

    if (settings.containsKey(SettingType.twitterClientId)
        && !Utils.isEmptyString(settings.get(SettingType.twitterClientId))
        && user != null) {
      menu.add(
          actionMenuItem(
              "Enable Facebook",
              AbstractImagePrototype.create(Icons.INSTANCE.connection()),
              Action.facebook));
    }
    if (settings.containsKey(SettingType.facebookAPIKey)
        && !Utils.isEmptyString(settings.get(SettingType.facebookAPIKey))) {
      menu.add(
          actionMenuItem(
              "Enable Twitter",
              AbstractImagePrototype.create(Icons.INSTANCE.connection()),
              Action.twitter));
    }
    menu.add(
        actionMenuItem(
            "Enable Instant Message (XMPP)",
            AbstractImagePrototype.create(Icons.INSTANCE.list_items()),
            Action.xmpp));

    button.setMenu(menu);
    add(button);
  }
예제 #2
0
  private void createLanguagePanel() {
    selectLanguagePanel = new FlowPanel();
    selectLanguagePanel.addStyleName("selectLanguage");

    selectLanguagePanel.add(new HTML(R.lang.selectLanguage()));
    selectLanguagePanel.add(
        new Anchor(AbstractImagePrototype.create(R.img.flagEn()).getSafeHtml(), "frontend.jsp"));
    selectLanguagePanel.add(
        new Anchor(
            AbstractImagePrototype.create(R.img.flagDe()).getSafeHtml(), "frontend.jsp?locale=de"));
  }
예제 #3
0
  /**
   * The widget's constructor.
   *
   * @param newImages the image bundle passed on by the parent object
   */
  public SettingsMenu(final Images newImages) {
    // The popup's constructor's argument is a boolean specifying that it
    // auto-close itself when the user clicks outside of it.
    super(true);
    setAnimationEnabled(true);
    images = newImages;

    Command userCredentialsCommand =
        new Command() {
          @Override
          public void execute() {
            CredentialsDialog dlg = new CredentialsDialog(newImages);
            dlg.center();
          }
        };
    contextMenu = new MenuBar(true);
    //		contextMenu.addItem("<span>" + newImages.preferences().getHTML() +
    // "&nbsp;Preferences</span>", true, cmd);
    MenuItem showCredentialsItem =
        new MenuItem(
            "<span>"
                + AbstractImagePrototype.create(newImages.credentials()).getHTML()
                + "&nbsp;Show Credentials</span>",
            true,
            userCredentialsCommand);
    showCredentialsItem.getElement().setId("topMenu.settingsMenu.showCredentials");
    contextMenu.addItem(showCredentialsItem);

    add(contextMenu);
    // setStyleName("toolbarPopup");
  }
 public CreateFolderViewportAction(final TreePanel treePanel) {
   super("CreateViewport", AbstractImagePrototype.create(BasicWidgetResources.ICONS.viewport()));
   this.treePanel = treePanel;
   this.executor =
       new Listener() {
         @Override
         public void handleEvent(BaseEvent be) {
           execute(selectedElement.getChildren(), selectedElement.getLabel());
           treePanel.removeListener(GeoPlatformEvents.GP_NODE_EXPANDED, this);
         }
       };
   this.message =
       new Listener<MessageBoxEvent>() {
         @Override
         public void handleEvent(MessageBoxEvent be) {
           if (be.getButtonClicked().getItemId().equalsIgnoreCase(Dialog.YES)) {
             treePanel.addListener(GeoPlatformEvents.GP_NODE_EXPANDED, executor);
             treePanel.setExpanded(selectedElement, true);
             System.out.println("Selected element: " + selectedElement);
           } else {
             treePanel.removeListener(GeoPlatformEvents.GP_NODE_EXPANDED, executor);
           }
         }
       };
 }
예제 #5
0
  private static Button connectionButton() {
    final Button b = new Button("&nbsp;Connect");
    b.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.email2()));

    b.addListener(Events.OnClick, new ConnectBaseEventListener());
    return b;
  }
  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);

    setId("settings-tabs-wrapper");
    setLayout(new FitLayout());

    m_tabsPanel = new TabPanel();
    m_tabsPanel.setPlain(true);
    m_tabsPanel.setBorders(false);
    m_tabsPanel.setBodyBorder(false);
    m_tabsPanel.setStyleAttribute("padding-top", "5px");

    m_snapshotsConfig = new TabItem(MSGS.settingsSnapshots());
    m_snapshotsConfig.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.snapshots()));
    m_snapshotsConfig.setBorders(true);
    m_snapshotsConfig.setLayout(new FitLayout());
    m_snapshotsConfig.add(m_snapshotsTab);
    m_tabsPanel.add(m_snapshotsConfig);

    m_certificatesConfig = new TabItem(MSGS.settingsAddSSLCertificates());
    m_certificatesConfig.setBorders(true);
    m_certificatesConfig.setLayout(new FitLayout());
    m_certificatesConfig.add(m_certificatesTab);
    m_tabsPanel.add(m_certificatesConfig);

    m_permissionsConfig = new TabItem(MSGS.permissions());
    m_permissionsConfig.setBorders(true);
    m_permissionsConfig.setLayout(new FitLayout());
    m_permissionsConfig.add(m_permissionsTab);
    m_tabsPanel.add(m_permissionsConfig);

    add(m_tabsPanel);
  }
예제 #7
0
  private ContentPanel buildConfigBloc(ConfigGroup configGroup, ImageResource icon) {
    final ContentPanel cPanel = new ContentPanel(new ColumnLayout());
    cPanel.setHeading(
        "<div class='config-title'>" + I18nUtils.getString(configGroup.key) + "</div>");
    cPanel.getHeader().addStyleName("config-header");
    cPanel.setCollapsible(true);
    cPanel.setAnimCollapse(false);
    cPanel.collapse();
    cPanel.setIcon(AbstractImagePrototype.create(icon));
    cPanel.addListener(
        Events.Expand,
        new Listener<ComponentEvent>() {

          @Override
          public void handleEvent(ComponentEvent be) {
            cPanel.layout(true);
          }
        });

    cPanel.getHeader().addDomHandler(this, ClickEvent.getType());
    mapConfigGroupPanel.put(configGroup, cPanel);
    mapHeaderGroup.put(cPanel.getHeader(), cPanel);

    return cPanel;
  }
예제 #8
0
 /**
  * Generates HTML for a tree item with an attached icon.
  *
  * @param imageProto the image prototype to use
  * @param title the title of the item
  * @return the resultant HTML
  */
 private HTML imageItemHTML(ImageResource res, String title) {
   AbstractImagePrototype imageProto = AbstractImagePrototype.create(res);
   HTML label = new HTML(imageProto.getHTML() + " " + title);
   label.addClickHandler(this);
   label.addClickHandler((ClickHandler) parent);
   return label;
 }
/**
 * abstract cell class for rendering recommendation icon
 *
 * @author Lucas Reeh
 */
public class RecommendedChartCell extends AbstractCell<Boolean> {

  final AbstractImagePrototype imageRes =
      AbstractImagePrototype.create(COModuleRecommenderResources.IMAGES.star_16());

  final Image image = imageRes.createImage();

  /** @param consumedEvents */
  public RecommendedChartCell(Set<String> consumedEvents) {
    super(consumedEvents);
    image.setTitle(COModuleRecommenderResources.TEXT.recommendationFromStudentsLong());
  }

  /** @param consumedEvents */
  public RecommendedChartCell(String... consumedEvents) {
    super(consumedEvents);
    image.setTitle(COModuleRecommenderResources.TEXT.recommendationFromStudentsLong());
  }

  @Override
  public void render(Context context, Boolean value, SafeHtmlBuilder sb) {
    if (value) {
      SafeHtml html = SafeHtmlUtils.fromTrustedString(image.toString());
      sb.append(html);
    }
  }
}
 public LoadKmlFromUrlTreeAction(TreePanel theTree) {
   super(
       theTree,
       AbstractImagePrototype.create(LayerResources.ICONS.loadKmlFromURL()),
       LayerModuleConstants.INSTANCE.LoadKmlFromUrlTreeAction_tooltipText());
   this.kmlWidget = new LoadKmlFromUrlWidget(theTree);
 }
예제 #11
0
  private Button pendingConnectionsButton() throws NimbitsException {
    final Button connectionRequest = new Button("Connection Requests(" + connectionCount + ')');

    connectionRequest.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.add16()));
    service.getPendingConnectionRequests(
        user.getEmail(), new GetPendingRequestListAsyncCallback(connectionRequest));
    return connectionRequest;
  }
예제 #12
0
  private Button addChartButton() {
    Button addChartButton = new Button("&nbsp;Add Chart");
    addChartButton.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.lineChart()));
    addChartButton.setToolTip("Add another chart");

    addChartButton.addListener(Events.OnClick, new AddChartBaseEventListener());
    return addChartButton;
  }
예제 #13
0
 public void renameSelected(final String name) {
   ((CategoryItem) navTreeWidget.getSelectedItem().getUserObject()).setName(name);
   navTreeWidget
       .getSelectedItem()
       .setHTML(
           AbstractImagePrototype.create(ImageResources.INSTANCE.categorySmall()).getHTML()
               + h(name));
 }
예제 #14
0
  private MenuItem newDataPoint() {
    final MenuItem item = new MenuItem("Data Point");

    item.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.addNew()));
    item.setToolTip(UserMessages.MESSAGE_NEW_POINT);
    item.addListener(Events.OnClick, new NewPointBaseEventListener());

    return item;
  }
예제 #15
0
  private MenuItem uploadFile() {
    MenuItem item = new MenuItem("Upload File");

    item.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.diagram()));

    item.addListener(Events.OnClick, uploadFileListener);

    return item;
  }
예제 #16
0
  private void addHelpMenu() {
    Button button = new Button("Help");
    Menu menu = new Menu();

    menu.add(
        urlMenuItem(
            "Forum",
            AbstractImagePrototype.create(Icons.INSTANCE.Help()),
            "http://groups.google.com/group/nimbits"));
    menu.add(
        urlMenuItem(
            "nimbits.com",
            AbstractImagePrototype.create(Icons.INSTANCE.Home()),
            "http://www.nimbits.com"));

    button.setMenu(menu);
    add(button);
  }
예제 #17
0
  public TreeItem buildTreeItem(final CategoryItem category) {
    final TreeItem it = new TreeItem();
    it.setHTML(
        AbstractImagePrototype.create(ImageResources.INSTANCE.categorySmall()).getHTML()
            + h(category.getName()));
    it.setUserObject(category);

    return it;
  }
예제 #18
0
  private MenuItem newFolder() {
    MenuItem item = new MenuItem("New Folder");

    item.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.category()));

    item.addListener(Events.OnClick, new AddFolderBaseEventListener());

    return item;
  }
예제 #19
0
 public EditWFSAction(TreePanel<GPBeanTreeModel> treePanel) {
   super(
       WFSTWidgetConstants.INSTANCE.EditWFSAction_titleText(),
       AbstractImagePrototype.create(BasicWidgetResources.ICONS.vector()));
   this.treePanel = treePanel;
   this.bus = FeatureInjector.MainInjector.getInstance().getEventBus();
   this.layerTypeHandlerManager =
       FeatureInjector.MainInjector.getInstance().getLayerTypeHandlerManager();
 }
예제 #20
0
 private MenuItem acceptConnectionMenuItem(final Menu scrollMenu, final ConnectionRequest r)
     throws NimbitsException {
   final MenuItem m = new MenuItem(r.getRequestorEmail().getValue());
   m.setIcon(AbstractImagePrototype.create(Icons.INSTANCE.connection()));
   m.addListener(
       Events.Select,
       new AcceptConnectionBaseEventListener(r, scrollMenu, m, connectionRequest));
   return m;
 }
  /**
   * Make icons available as SafeHtml
   *
   * @param resource
   * @return
   */
  private static SafeHtml makeImage(ImageResource resource) {
    AbstractImagePrototype proto = AbstractImagePrototype.create(resource);

    // String html = proto.getHTML().replace("style='",
    // "style='left:0px;top:0px;"); // position:absolute;
    //
    // return SafeHtmlUtils.fromTrustedString(html);

    return proto.getSafeHtml();
  }
예제 #22
0
  private void addNavigateMenu() {
    Button button = new Button("Navigate");
    Menu menu = new Menu();
    menu.add(
        actionMenuItem(
            "Toggle Expansion",
            AbstractImagePrototype.create(Icons.INSTANCE.expand()),
            Action.expand));

    button.setMenu(menu);
    add(button);
  }
예제 #23
0
  public class GroupingViewImages extends GridViewImages {
    private AbstractImagePrototype groupBy =
        AbstractImagePrototype.create(GXT.IMAGES.grid_groupBy());

    public AbstractImagePrototype getGroupBy() {
      return groupBy;
    }

    public void setGroupBy(AbstractImagePrototype groupBy) {
      this.groupBy = groupBy;
    }
  }
예제 #24
0
 private Button buildNewToolRequestMenuItem() {
   Button newToolBtn = new Button(org.iplantc.core.tito.client.I18N.DISPLAY.requestNewTool());
   newToolBtn.setIcon(AbstractImagePrototype.create(Resources.ICONS.add()));
   newToolBtn.addSelectionListener(
       new SelectionListener<ButtonEvent>() {
         @Override
         public void componentSelected(ButtonEvent ce) {
           new NewToolRequestWindow().show();
         }
       });
   newToolBtn.setId(ID_BTN_NEW_TOOL_BTN);
   return newToolBtn;
 }
 @Override
 public void finalizeInitOperations() {
   super.finalizeInitOperations();
   super.selectButton.setText(
       LayerModuleConstants.INSTANCE.GPProjectSearchPanel_selectButtonText());
   super.search.setFieldLabel(
       LayerModuleConstants.INSTANCE.GPProjectSearchPanel_searchlabelText());
   GPProjectAction action = new GPProjectAction(GPTrustedLevel.HIGH, this);
   GPSecureButton addProjectButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.addText(),
           AbstractImagePrototype.create(LayerResources.ICONS.projectAdd()),
           action);
   super.addButton(1, addProjectButton);
   addProjectButton.disable();
   this.editButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.editText(),
           AbstractImagePrototype.create(BasicWidgetResources.ICONS.edit()),
           action);
   this.editButton.disable();
   super.addButton(2, this.editButton);
   this.deleteButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.deleteText(),
           AbstractImagePrototype.create(LayerResources.ICONS.projectDelete()),
           new DeleteProjectAction(GPTrustedLevel.FULL, this));
   this.deleteButton.disable();
   super.addButton(3, this.deleteButton);
   ShareProjectAction shareProjectAction = new ShareProjectAction(GPTrustedLevel.HIGH, this);
   this.shareButton =
       new GPSecureButton(
           ButtonsConstants.INSTANCE.shareText(),
           AbstractImagePrototype.create(LayerResources.ICONS.arrowRefresh()),
           shareProjectAction);
   this.shareButton.disable();
   super.addButton(4, this.shareButton);
 }
예제 #26
0
  private void addAdminMenu() {
    Button button = new Button("Admin");
    Menu menu = new Menu();
    menu.add(
        urlMenuItem(
            "Run System Maintenance Service",
            AbstractImagePrototype.create(Icons.INSTANCE.expand()),
            "http://"
                + com.google.gwt.user.client.Window.Location.getHostName()
                + "/cron/SystemMaint"));

    button.setMenu(menu);
    add(button);
  }
예제 #27
0
  public void init() {
    toolBar = new PagingToolBar(5, true);
    getStore();
    // initwidget();
    store.addBaseStoreListener(BaseStoreEvent.EventType.LOAD_COMPLETE, this);

    printer = new Button("打印");
    // printer.setStyleName("printer");
    // printer.setIconStyle("printer");
    // printer.setId("printer");
    printer.setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.print_16()));

    printer.addListener(Events.Select, this);
  }
예제 #28
0
  public MainMenuBar(final User user, final Map<SettingType, String> settings, boolean isDomain)
      throws NimbitsException {
    this.user = user;
    this.settings = settings;
    service = GWT.create(UserService.class);

    addFileMenu();
    addNavigateMenu();
    addActionMenu();
    addOptionsMenu();

    if (user.isUserAdmin()) {
      addAdminMenu();
    }
    addHelpMenu();
    add(new SeparatorMenuItem());

    //  add(saveButton());
    add(addChartButton());

    // add(connectionButton());
    // add(pendingConnectionsButton());

    add(
        urlMenuItem(
            "Report Issue",
            AbstractImagePrototype.create(Icons.INSTANCE.bug()),
            "https://github.com/bsautner/com.nimbits/issues"));

    if (!isDomain) {
      add(
          actionMenuItem(
              "Logout",
              AbstractImagePrototype.create(Icons.INSTANCE.deleteFriend()),
              Action.logout));
    }
  }
예제 #29
0
  private void initWidget() {
    initmainpanel();
    addfinace.setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.addfinance()));
    d.setHeading("添加新会员");
    d.setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.contact24()));
    d.setLayout(new RowLayout(Orientation.HORIZONTAL));

    d.setButtons(Dialog.YESNO);
    d.getButtonById(Dialog.YES).setText("添加新会员");
    d.getButtonById(Dialog.NO).setText("关闭");
    d.getButtonById(Dialog.YES)
        .setIcon(AbstractImagePrototype.create(BaseResource.INSTANCE.contact24()));

    d.getButtonById(Dialog.YES).addListener(Events.Select, this);
    d.getButtonById(Dialog.NO).addListener(Events.Select, this);

    d.add(w, new RowData(1, 1));

    d.setSize(607, 373);
    // d.setAutoHeight(true);
    // d.setAutoWidth(true);

    store._LoadComplete();
  }
 @Inject
 public SubTabNetworkClusterView(
     SearchableDetailModelProvider<
             PairQueryable<Cluster, NetworkCluster>, NetworkListModel, NetworkClusterListModel>
         modelProvider) {
   super(modelProvider);
   displayImage =
       SafeHtmlUtils.fromTrustedString(
           AbstractImagePrototype.create(resources.networkMonitor()).getHTML());
   migrationImage =
       SafeHtmlUtils.fromTrustedString(
           AbstractImagePrototype.create(resources.migrationNetwork()).getHTML());
   glusterNwImage =
       SafeHtmlUtils.fromTrustedString(
           AbstractImagePrototype.create(resources.glusterNetwork()).getHTML());
   emptyImage =
       SafeHtmlUtils.fromTrustedString(
           AbstractImagePrototype.create(resources.networkEmpty()).getHTML());
   managementImage =
       SafeHtmlUtils.fromTrustedString(
           AbstractImagePrototype.create(resources.mgmtNetwork()).getHTML());
   initTable();
   initWidget(getTable());
 }