Examples of PopupMenu


Examples of org.cafesip.gwtcomp.client.ui.PopupMenu

        return menu;
    }

    private PopupMenu createRealmsContextMenu()
    {
        PopupMenu menu = new PopupMenu();

        HTML refresh = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/reload.png", "Refresh"));
        ClickListener listener = new RealmOperationListener(
                RealmOperationListener.REALMS_REFRESH);
        refresh
                .addClickListener(new TreeContextMenuItemListener(menu,
                        listener));
        menu.addMenuItem(refresh);

        menu.addSeparator();

        HTML list = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/view_tree.png", "List Realms")); // icon?
        listener = new RealmOperationListener(
                RealmOperationListener.REALMS_LIST);
        list.addClickListener(new TreeContextMenuItemListener(menu, listener));
        menu.addMenuItem(list);

        HTML create = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/edit_add.png", "Add a Realm"));
        listener = new RealmOperationListener(RealmOperationListener.REALM_ADD);
        create
                .addClickListener(new TreeContextMenuItemListener(menu,
                        listener));
        menu.addMenuItem(create);

        return menu;
    }
View Full Code Here

Examples of org.cafesip.gwtcomp.client.ui.PopupMenu

        return menu;
    }

    private PopupMenu createRealmContextMenu(String realm)
    {
        PopupMenu menu = new PopupMenu();

        HTML view = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/view_detailed.png", "View Properties"));
        ClickListener listener = new RealmOperationListener(
                RealmOperationListener.REALM_VIEW_PROPERTIES, realm);
        view.addClickListener(new TreeContextMenuItemListener(menu, listener));
        menu.addMenuItem(view);

        HTML manage = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/kuser.png", "Manage Users"));
        listener = new RealmOperationListener(
                RealmOperationListener.REALM_USER_MANAGE, realm);
        manage
                .addClickListener(new TreeContextMenuItemListener(menu,
                        listener));
        menu.addMenuItem(manage);

        HTML delete = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
                + "gwtcomp-icons/editdelete.png", "Remove the Realm"));
        listener = new RealmOperationListener(
                RealmOperationListener.REALM_DELETE, realm);
        delete
                .addClickListener(new TreeContextMenuItemListener(menu,
                        listener));
        menu.addMenuItem(delete);

        return menu;
    }
View Full Code Here

Examples of org.gwt.mosaic.ui.client.PopupMenu

        timespanButton.setStyle(ToolButton.ToolButtonStyle.MENU);
        timespanButton.getElement().setAttribute("style", "padding-right:0px;background-image:none;");
        timespanButton.setVisible(false);

        final PopupMenu timeBtnMenu = new PopupMenu();

        for(final TimespanValues ts : TimespanValues.values())
        {
            timeBtnMenu.addItem(ts.getCanonicalName(), new Command()
            {
                public void execute()
                {

                    LoadDatasetEvent theEvent = new LoadDatasetEvent();
View Full Code Here

Examples of org.openfaces.component.command.PopupMenu

            rowGroups.add(parentRowGroup);
            addContainingRowGroupsForThisRow(rowGroups, parentGroupRowInfo);
        }

        private PopupMenu getMenuWithFunctions(FacesContext context, List<SummaryFunction> applicableFunctions) {
            PopupMenu popupMenu = null;
            UIComponent popupMenuContainer = getPopupMenuContainer(context);
            List<UIComponent> children = popupMenuContainer.getChildren();
            final String summaryFunctionsAttribute = "_summaryFunctions";
            for (UIComponent child : children) {
                PopupMenu m = (PopupMenu) child;
                List<SummaryFunction> summaryFunctions = (List<SummaryFunction>) m.getAttributes().get(summaryFunctionsAttribute);
                if (applicableFunctions.equals(summaryFunctions)) {
                    popupMenu = m;
                }
            }
View Full Code Here

Examples of org.sf.feeling.swt.win32.extension.widgets.PopupMenu

    });


    Object treeMenu ;
    if(XPWidgetTheme.isPlatform()) { 
      PopupMenu popupMenu = new PopupMenu(tree, XPWidgetTheme.THEME);
      treeMenu = new CMenu();
      popupMenu.setMenu((CMenu)treeMenu);
    } else {
      treeMenu = new Menu(getShell(), SWT.POP_UP);
      tree.setMenu((Menu)treeMenu);
    }

    factory.createStyleMenuItem( treeMenu, "itemAdd", "+.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        try {
          traverseTree(TreeHandler.SELECT, addItems());
        } catch (Exception e) {
          ClientLog.getInstance().setMessage(tree.getShell(), e);
        }
      }  
    })

    factory.createStyleMenuItem(treeMenu, "itemRemove", "-.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        try {
          traverseTree(TreeHandler.REMOVE, new String[]{});
          removeItem();
          traverseTree(TreeHandler.SELECT, lstPath.getItems());
        } catch (Exception e) {
          ClientLog.getInstance().setMessage(tree.getShell(), e);
        }
      }  
    });  

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem(treeMenu, "itemExpand", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expand(true);
      }  
    });

    factory.createStyleMenuItem(treeMenu, "itemCollapse", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expand(false);
      }  
    });

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem(treeMenu, "itemExpandDataNode", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        expandDataNode();
      }  
    });

    factory.createStyleMenuItem(treeMenu, "itemCollapseTree", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        TreeItem [] items = tree.getItems();
        if(items == null) return;
        for(TreeItem item : items) {
          expand(item, false);
        }
      }  
    });

    factory.createStyleMenuItem(treeMenu, SWT.SEPARATOR);

    factory.createStyleMenuItem( treeMenu, "itemView", "view.gif", new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent evt) {
        viewItem();
      }  
    });  

    sash0.setWeights( new int[]{500, 300});    
    handler = new TreeHandler();       

    Composite bottom = new Composite(this, SWT.NONE);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    bottom.setLayoutData(gridData);
    factory.setComposite(bottom);

    gridLayout = new GridLayout(1, false);
    gridLayout.marginHeight = 2;
    gridLayout.horizontalSpacing = 5;
    gridLayout.verticalSpacing = 0;
    gridLayout.marginWidth = 2;
    bottom.setLayout(gridLayout);

    txtPath = new NodeEditor2(bottom, this);
    txtPath.setFont(UIDATA.FONT_10B);
    gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.heightHint = 70;
    if(UIDATA.isMacOS) {
      //      gridData.heightHint = 30;
      txtPath.setFont(UIDATA.FONT_11B);
    }

    txtPath.setLayoutData(gridData);
    /*txtPath.addKeyListener(new KeyAdapter() {
      public void keyPressed(KeyEvent event) {
        if(event.keyCode == SWT.CR) {
          addEditItem();
          event.doit = false;
        }
      }
    });*/

    /*txtPath.text.setDoubleClickEnabled(false);
    txtPath.text.addMouseListener(new MouseAdapter() {

      public void mouseDown(MouseEvent e) {
        if(e.count == 3) {
          txtPath.setText("");         
          return;
        }

        if(e.button == 2) {
          if(txtPath.getText().trim().isEmpty()) return;
          addEditItem();
        }
      }


      @SuppressWarnings("unused")
      public void mouseDoubleClick(MouseEvent e) {
        new TemplateHandlerAction(new char[]{'[', ']'}).handle(txtPath.text);
      }
    });*/


    lstPath = factory.createList(bottom, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
    lstPath.setFont(UIDATA.FONT_10B);
    lstPath.addSelectionListener(new SelectionAdapter(){
      @SuppressWarnings("unused")
      public void widgetSelected(SelectionEvent e){
        int selectedIndex = lstPath.getSelectionIndex();
        if(selectedIndex < 0) return;
        String path  = lstPath.getItem(selectedIndex);
        txtPath.setText(path);
        List<String> removes = null;
        try {
          removes = traverseTree(TreeHandler.SELECT, new String[]{path});
        } catch (Exception exp) {
          ClientLog.getInstance().setMessage(tree.getShell(), exp);
        }
        if(removes == null) return ;
        for(String ele : removes) lstPath.remove(ele);
        if(removes.size() > 0 && lstPath.getItemCount() > 0) lstPath.select(0);
      }
    });

    Object menu;

    if(XPWidgetTheme.isPlatform()) { 
      PopupMenu popupMenu = new PopupMenu(lstPath, XPWidgetTheme.THEME);
      menu = new CMenu();
      popupMenu.setMenu((CMenu)menu);
    } else {
      menu = new Menu(getShell(), SWT.POP_UP);
      lstPath.setMenu((Menu)menu);
    }

View Full Code Here

Examples of org.sf.feeling.swt.win32.extension.widgets.PopupMenu

//        new TemplateHandlerAction(new char[]{'[', ']'}).handle(txtPath.text);
      }
    });
   
    if(XPWidgetTheme.isPlatform()) { 
      PopupMenu popupMenu = new PopupMenu(text, XPWidgetTheme.THEME);
      CMenu menu = new CMenu();
      popupMenu.setMenu(menu);
      text.setMenu(new Menu(text.getShell(), SWT.POP_UP));
      CMenuItem item = new CMenuItem(SWT.NONE);
      item.addSelectionListener(new SelectionAdapter() {
        @SuppressWarnings("unused")
        public void widgetSelected(SelectionEvent e) {
View Full Code Here

Examples of pdfdb.data.filetable.MenuManager.PopupMenu

    public void menuUpdate(ActionEvent event)
    {
        ColumnData data = ColumnData.getInstance();
        Object src = event.getSource();
        JCheckBoxMenuItem item = (JCheckBoxMenuItem) src;
        PopupMenu menu = (PopupMenu) item.getParent();
        String key = event.getActionCommand();
        int selectedCount = 0;
        for (JMenuItem x : menu)
        {
            selectedCount += x.isSelected() ? 1 : 0;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.