Menu Item Icons

Hi,
I was wondering if there was a simple way to add an icon to the specific items in the menu bar. I see that there is a property in the portal file to select an active, inactive, and rollover image; but using them will replace the page/book title. I would like to have both an icon and the title visible.

Hi
Try one more thing using the css file(s). Take any existing look and feel like default big horn look and feel. Add that to your project from Project Explorer View. By default all the files are in shared modules for look and feel stuff. Overwrite custom.css file with specific stuff related to Menu. First try just by changing like Fontsize, color for the Menu Items. Then you can modify .css files entries for Menu by adding Icons images in css file itself. If you want to control specific menu items only with different icons, you can do more customization.
http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html#wp1032617
http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html
http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portals/develop_ui_lookfeel.html#wp1059262
Thanks
Ravi Jegga

Similar Messages

  • Menu item icon not updating

    Hi,
    I have an action into which I set an Icon:
    action.putValue(Action.SMALL_ICON, icon1);
    now I set this action into my menu item and show the item in a menu. The item displays correctly and the icon is visible.
    later in the program i do:
    action.putValue(Action.SMALL_ICON, icon2);
    then I open the menu but the menu item still shows icon1 until I roll over it with the cursor when it finally changes to icon2.
    Any ideas on how to make this update immediate?
    BTW at the point of changing the icon, I don't have access to the menu item or the frame etc, just the action.
    Thanks a lot,
    Jim

    Anyone got any more ideas?Maybe you have a programming problem, but we can't see your code so we don't know for sure.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • How to add an Icon to a parent menu item in Command Center?

    Hi guys,
    does anybody know how to add an icon to a parent maenu item in Command Center? BTW, I'm using SBO 6.5
    Cheers,
    Oki

    The SDK doesn't provide any features for adding icons to the command center in SBO6.5.
    Version 2004 has a new image property for menu items that can be used.
    John.

  • Windows and icons are black, menu items are not showing correctly

    Hello!
    Well just doing my normal routine today browsing the Internet, watching videos on vlc, my computer suddenly started to glitch. Icons were disappearing, Safari turned black.
    So i did a restart but the problem is still there. I cant even choose the user properly because the avatars are not there it's just all dark gray. Remembering where my user avatar is, i do a click and type in my password and I do and able to get in to my system but all windows menu items and icons are black.
    Basically what I'm saying is the system seems to be working fine except for that I can't see the icons and windows properly displayed.
    I've already tried to reinstall of Mavericks hoping that it's a software thing. You guys think it's a problem with the graphic processor?
    Any help or suggestions will be appreciated thank you.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It changes nothing, and therefore will not, in itself, solve your problem.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The procedure will help identify which such modifications you've installed, as well as certain other aspects of the configuration that may have a bearing on the problem. Don’t be alarmed by the apparent complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode, if possible. If you’re now running in safe mode, reboot as usual before continuing. If you can only boot in safe mode, you can still use this procedure, but not all of it will work. Be sure to mention that in your reply, if you haven't already done so. 
    Below are instructions to enter UNIX shell commands. The commands are safe and do nothing but produce human-readable text output, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. I am not asking you to trust me. If you can't satisfy yourself that these instructions are safe, don't follow them.
    The commands will line-wrap or scroll in your browser, but each one is really just a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it.
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. Step 1 should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply.
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click anywhere in the line of text below on this page to select it:
    { echo "Loaded kernel extensions:"; kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}'; echo $'\n'"Loaded user agents:"; launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}'; echo $'\n'"Inserted libraries:"; launchctl getenv DYLD_INSERT_LIBRARIES; echo $'\n'"User cron tasks:"; crontab -l; echo $'\n'"System launchd configuration:"; cat /e*/lau*; echo $'\n'"User launchd configuration:"; cat .lau*; echo $'\n'"Login items:"; osascript -e 'tell application "System Events" to get name of login items' | sed $'s/, /\\\n/g'; echo $'\n'"Safari extensions:"; /usr/libexec/PlistBuddy -c Print L*/Saf*/*/E*.plist | awk -F'= ' '/Bundl/{print $2}' | sed 's/\..*$//;s/-[1-9]$//'; printf "\nRestricted user files: %s\n" $(find ~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \) | wc -l); echo $'\n'"Extrinsic loadable bundles:"; cd; find -L /S*/L*/E* {,/}L*/{Ad,Compon,Ex,In,Keyb,Mail/Bu,P*P,Qu,Scripti,Servi,Spo}* -type d -name Contents -prune | while read d; do /usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$d/Info.plist" | egrep -qv "^com\.apple\.[^x]|Accusys|ArcMSR|ATTO|HDPro|HighPoint|driver\.stex|hp-fax|JMicron|print|SoftRAID" && echo ${d%/Contents}; done; echo $'\n'"Unsigned shared libraries:"; find /u*/{,*/}lib -type f -exec sh -c 'file -b $1 | grep -qw shared && ! codesign -v $1' {} {} \; -print; echo; ls -A {,/}L*/{La,Priv,Sta}* L*/Fonts; } 2> /dev/null | open -ef
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    The command may take up to a few minutes to run, depending on how many files you have and the speed of the computer. A TextEdit window will open with the output. Post the contents of the TextEdit window (not the Terminal window) — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Remember that you must be logged in as an administrator for this step. Do as in Step 1 with this line:
    { echo "Loaded system agents:"; sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix\.cron)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; echo $'\n'"Login hook:"; sudo defaults read com.apple.loginwindow LoginHook; echo $'\n'"Root cron tasks:"; sudo crontab -l; echo $'\n'"Log check:"; syslog -k Sender kernel -k Message CReq 'GPU |hfs: Ru|I/O e|find tok|n Cause: -|NVDA\(|pagin|timed? ?o' | tail | awk '/:/{$4=""; print}'; } 2> /dev/null | open -ef
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    You can then quit Terminal.
    To prevent confusion, I'll repeat: When you type your password in the Terminal window, you won't see what you're typing.
    Note: If you don’t have a login password, set one before taking Step 2. If that’s not possible, skip the step.
    Important: If any personal information, such as your name or email address, appears in the output of these commands, anonymize it before posting. Usually that won't be necessary.
    Remember, Steps 1 and 2 are all copy-and-paste — no typing, except your password. Also remember to post the output as text, not as a screenshot.
    Please post the contents of the TextEdit window, not the Terminal window.

  • Shorten Menu items to make room for more icons in menu bar

    Is there any way to shorten the menu items in the menu bar, so that there will be more space for the icons? For instance, in Safari, the first Menu item, File, could be abbreviated to F, Edit could be E, etc. That way, the shortcuts for apps through icons in the menu bar would have more space, to permit more icons to be shown.
    An option, although not a full fledged one, would be to configure the icons in much the same way as in the dock, drag and drop them to the desired location.
    Any thoughts on this?

    Not possible by normal methods - some hacking is required.

  • Xfce4 missing icons for menu items

    My xfce4 seems to have blank icons for some of the menu items and I can't figure out why. I installed the entire xfce4 and xfce4-goodies groups.

    maggie: are you talking about icons in the Applications menu applet? If yes, are the icons missing for applications which do not provide icons¹? If yes, then you have the answer: there is no icon displayed because there is no icon to display for the entry.
    AFAIR, the pre-4.12 Applications menu applet displayed some ugly stock icon as a placeholder, but it seems that this behaviour is no longer present in the latest release. If you truly want icons for the entries, you may set them by editing corresponding .desktop entries. The best way is placing your overrides in ~/.local/share/applications as this will not pollute pacman-managed /usr/share/applications directory.
    ¹ See the corresponding .desktop entry in /usr/share/applications/ or ~/.local/share/applications

  • Iconic menu-items like in ms-office

    is it possible to show the icon of a menu-item and also the text of the menu-item?
    When I switch the "icon in menu" property to "Yes" then automatically the "Label" isn't visible.
    In Excel e.g. you see the icon and the label of the menu-item side by side.

    Is it possible to display both label and icon in a popup menu item?
    if yes ,
    where to place the icons?are there any parameters configurations requirements?

  • Adding icons to menu items

    Okay, I'm a newbie at Java. I have a problem that I'm trying to solve. I added icons to the File menu item, that was easy, but how do I add icons to the other menu items? They are DefaultEditorKit. actions (cut copy paste undo redo) I can't seem to change their names either.
    I'm also having problems with saving the changes I make in the text area.
    Here's the whole code.
    package components;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.HashMap;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.AbstractButton;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import javax.swing.undo.*;
    public class TextComponentDemo extends JFrame implements ActionListener {
        JTextPane textPane;
        AbstractDocument doc;
        JTextArea changeLog;
        JButton newButton, openButton, saveButton, undoButton, redoButton, /*cutButton, copyButton, pasteButton,*/ boldButton, italicButton, underlineButton;
        protected String newline = "\n";
        HashMap<Object, Action> actions;
         File fFile = new File("default.txt");
         JavaFilter fJavaFilter = new JavaFilter();
        protected UndoAction undoAction;
        protected RedoAction redoAction;
        protected UndoManager undo = new UndoManager();
        public TextComponentDemo() {
            super("Notepad v1.0");
            //Create the text pane and configure it.
            textPane = new JTextPane();
            textPane.setCaretPosition(0);
            textPane.setMargin(new Insets(5,5,5,5));
            StyledDocument styledDoc = textPane.getStyledDocument();
            if (styledDoc instanceof AbstractDocument) {
                doc = (AbstractDocument)styledDoc;
            } else {
                System.err.println("Text pane's document isn't an AbstractDocument!");
                System.exit(-1);
            JScrollPane scrollPane = new JScrollPane(textPane);
            scrollPane.setPreferredSize(new Dimension(600, 350));
            newButton = new JButton ("", createImageIcon("images/new.png"));
            newButton.setBackground(Color.white);
       //     newButton.setActionCommand("nou");       
       //     newButton.addActionListener(this);        
            openButton = new JButton("", createImageIcon("images/open.png"));
            openButton.setBackground(Color.white);
            openButton.setActionCommand("deschide");       
            openButton.addActionListener(this);
            saveButton = new JButton("", createImageIcon("images/save.png"));
            saveButton.setBackground(Color.white);
            saveButton.setActionCommand("salveaza");       
            saveButton.addActionListener(this);
            Action actionBold = new StyledEditorKit.BoldAction();
            actionBold.putValue(Action.NAME, "Bold");
            boldButton = new JButton(actionBold);
            boldButton.setBackground(Color.white);
            Action actionItalic = new StyledEditorKit.ItalicAction();
            actionItalic.putValue(Action.NAME, "Italic");
            italicButton = new JButton(actionItalic);
            italicButton.setBackground(Color.white);
            Action actionUnderline = new StyledEditorKit.UnderlineAction();
            actionUnderline.putValue(Action.NAME, "Underline");
            underlineButton = new JButton(actionUnderline);
            underlineButton.setBackground(Color.white);
              String[] fontStrings = { "Arial", "Arial Black", "Comic Sans MS", "Georgia", "Serif", "SansSerif", "Times New Roman", "Trebuchet MS", "Verdana" };
              JComboBox fontList = new JComboBox(fontStrings);
            fontList.setSelectedIndex(0);
            fontList.setBackground(Color.white);
            fontList.setActionCommand("font");
            fontList.addActionListener(this);
               String[] sizeStrings = { "12", "14", "16", "18", "20", "22", "24", "36", "48" };
              JComboBox sizeList = new JComboBox(sizeStrings);
            sizeList.setSelectedIndex(0);
            sizeList.setBackground(Color.white);
            sizeList.setActionCommand("size");
            sizeList.addActionListener(this);
            JPanel buttonPanel = new JPanel(); //use FlowLayout
              buttonPanel.add(newButton);
            buttonPanel.add(openButton);
            buttonPanel.add(saveButton);
         //   buttonPanel.add(cutButton);
         //   buttonPanel.add(copyButton);
         //   buttonPanel.add(pasteButton);
            buttonPanel.add(boldButton);
            buttonPanel.add(italicButton);
            buttonPanel.add(underlineButton);
            buttonPanel.add(fontList);
            buttonPanel.add(sizeList);
            getContentPane().add(buttonPanel, BorderLayout.PAGE_START);
             getContentPane().add(scrollPane, BorderLayout.CENTER);
            //Set up the menu bar.
            createActionTable(textPane);
            JMenu fileMenu = createFileMenu();
            JMenu editMenu = createEditMenu();
            JMenu fontMenu = createFontMenu();
            JMenu ajutorMenu = createAjutorMenu();
            JMenuBar mb = new JMenuBar();
            mb.add(fileMenu);
            mb.add(editMenu);
            mb.add(fontMenu);
            mb.add(ajutorMenu);
            setJMenuBar(mb);
            //Start watching for undoable edits and caret changes.
            doc.addUndoableEditListener(new MyUndoableEditListener());
           //This one listens for edits that can be undone.
        protected class MyUndoableEditListener
                        implements UndoableEditListener {
            public void undoableEditHappened(UndoableEditEvent e) {
                //Remember the edit and update the menus.
                undo.addEdit(e.getEdit());
                undoAction.updateUndoState();
                redoAction.updateRedoState();
    private ImageIcon createImageIcon (String fileName) {
          return new ImageIcon(fileName);
    protected JMenu createFileMenu() {
              JMenu menu = new JMenu("Fisier");
              menu.setMnemonic(KeyEvent.VK_F);
            JMenuItem menuItem;
            ImageIcon iconNou = new ImageIcon("images/new.png");
            menuItem = new JMenuItem("Nou", iconNou);
            menuItem.setMnemonic(KeyEvent.VK_N);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
       //   menuItem.setActionCommand("nou");       
       //   menuItem.addActionListener(this);         
            menu.add(menuItem);
         menu.addSeparator();
              ImageIcon iconOpen = new ImageIcon("images/open.png");
              menuItem = new JMenuItem("Deschide", iconOpen);
            menuItem.setMnemonic(KeyEvent.VK_O);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("deschide");       
            menuItem.addActionListener(this);
              menu.add(menuItem);
              ImageIcon iconSave = new ImageIcon("images/save.png");
              menuItem = new JMenuItem("Salveaza", iconSave);
            menuItem.setMnemonic(KeyEvent.VK_S);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("deschide");       
            menuItem.addActionListener(this);
              menu.add(menuItem);          
         menu.addSeparator();     
              ImageIcon iconQuit = new ImageIcon("images/quit.png");
              menuItem = new JMenuItem("Iesire", iconQuit);
            menuItem.setMnemonic(KeyEvent.VK_Q);
            menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
              menuItem.setActionCommand("iesire");       
            menuItem.addActionListener(this);
              menu.add(menuItem);                    
              return menu;
         public void actionPerformed(ActionEvent e) {
             boolean status = false;
           /* if ("nou".equals(e.getActionCommand())) {
                 nou();
            if ("deschide".equals(e.getActionCommand())) {
                 status = openFile();
                   if(!status)
                        JOptionPane.showMessageDialog(
                             null,
                             "Eroare la deschiderea fisierului!", "Fisierul nu a putut fi deschis.",
                             JOptionPane.ERROR_MESSAGE
          /* if ("salveaza".equals(e.getActionCommand())) {
                 status = saveFile();
                   if(!status)
                        JOptionPane.showMessageDialog(
                             null,
                             "Eroare IO in salvarea fisierului!", "Fisierul nu a putut fi salvat.",
                             JOptionPane.ERROR_MESSAGE
            if ("iesire".equals(e.getActionCommand())) {
                 System.exit(-1);
            if ("font".equals(e.getActionCommand())) {
                 JComboBox cb = (JComboBox)e.getSource();
                 String fontName = (String)cb.getSelectedItem();
                 String t = new String(textPane.getSelectedText());
    //               t.setText("fontName");
    //             t.setFont(new java.awt.Font(fontName, 0, 12));
    //               StyledEditorKit.FontFamilyAction font = new StyledEditorKit.FontFamilyAction(fontName, fontName);
         boolean openFile() {
                JFileChooser fc = new JFileChooser();
                fc.setDialogTitle("Deschide Fisier");
                fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
                fc.setCurrentDirectory(new File ("."));
                fc.setFileFilter(fJavaFilter);
                int result = fc.showOpenDialog(this);
                if(result == JFileChooser.CANCEL_OPTION) {
                     return true;
                else if(result == JFileChooser.APPROVE_OPTION) {
                     fFile = fc.getSelectedFile();
                     String file_string = readFile(fFile);
                     if(file_string != null) {
                          textPane.setText(file_string);
                     else
                          return false;
                else {
                     return false;
                return true;                                         
            public String readFile (File file) {
              StringBuffer fileBuffer;
             String fileString=null;
             String line;   
             try {
                   FileReader in = new FileReader (file);
                    BufferedReader dis = new BufferedReader (in);
                    fileBuffer = new StringBuffer () ;
                   while ((line = dis.readLine ()) != null) {
                     fileBuffer.append (line + "\n");
                    in.close ();
                    fileString = fileBuffer.toString ();
                  catch  (IOException e ) {
                    return null;
             return fileString;
    /* boolean saveFile () {
         File file = null;
         JFileChooser fc = new JFileChooser ();
         fc.setCurrentDirectory (new File ("."));
         fc.setFileFilter (fJavaFilter);
         fc.setSelectedFile (fFile);
         int result = fc.showSaveDialog (this);
         if (result == JFileChooser.CANCEL_OPTION) {
             return true;
         } else if (result == JFileChooser.APPROVE_OPTION) {
             fFile = fc.getSelectedFile ();
             if (fFile.exists ()) {
                 int response = JOptionPane.showConfirmDialog (null,
                   "Overwrite existing file?","Confirm Overwrite",
                    JOptionPane.OK_CANCEL_OPTION,
                    JOptionPane.QUESTION_MESSAGE);
                 if (response == JOptionPane.CANCEL_OPTION) return false;
             return writeFile (fFile, textPane.getText ());
         } else {
           return false;
      protected JMenu createEditMenu() {
            JMenu menu = new JMenu("Editare");
            menu.setMnemonic(KeyEvent.VK_E);
            JMenuItem menuItem;
            undoAction=new UndoAction();
            menu.add(undoAction);   
            redoAction = new RedoAction();
            menu.add(redoAction);
            menu.addSeparator();
              menu.add(getActionByName(DefaultEditorKit.cutAction));       
            menu.add(getActionByName(DefaultEditorKit.copyAction));
            menu.add(getActionByName(DefaultEditorKit.pasteAction));
            menu.addSeparator();
            menu.add(getActionByName(DefaultEditorKit.selectAllAction));
            return menu;
        //Create the style menu.
        protected JMenu createFontMenu() {
            JMenu menu = new JMenu("Font");
            menu.setMnemonic(KeyEvent.VK_F);
            JMenu subMenu = new JMenu ("Stil ");
            Action action = new StyledEditorKit.BoldAction();
            action.putValue(Action.NAME, "Bold");
            subMenu.add(action);
            action = new StyledEditorKit.ItalicAction();
            action.putValue(Action.NAME, "Italic");
            subMenu.add(action);
            action = new StyledEditorKit.UnderlineAction();
            action.putValue(Action.NAME, "Underline");
            subMenu.add(action);
              menu.add(subMenu);
            menu.addSeparator();
            JMenu subMenu2 = new JMenu ("Marime ");
            subMenu2.add(new StyledEditorKit.FontSizeAction("12", 12));
            subMenu2.add(new StyledEditorKit.FontSizeAction("14", 14));
            subMenu2.add(new StyledEditorKit.FontSizeAction("16", 16));
            subMenu2.add(new StyledEditorKit.FontSizeAction("18", 18));
            subMenu2.add(new StyledEditorKit.FontSizeAction("20", 20));
            subMenu2.add(new StyledEditorKit.FontSizeAction("22", 22));
            subMenu2.add(new StyledEditorKit.FontSizeAction("24", 24));
            subMenu2.add(new StyledEditorKit.FontSizeAction("36", 36));
            subMenu2.add(new StyledEditorKit.FontSizeAction("48", 48));
            menu.add(subMenu2);
            menu.addSeparator();
            JMenu subMenu3 = new JMenu ("Familie ");
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Arial", "Arial"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Arial Black", "Arial Black"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Comic Sans MS", "Comic Sans MS"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Georgia", "Georgia"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Serif", "Serif"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("SansSerif", "SansSerif"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Times New Roman", "Times New Roman"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Trebuchet MS", "Trebuchet MS"));
            subMenu3.add(new StyledEditorKit.FontFamilyAction("Verdana", "Verdana"));
            menu.add(subMenu3);
            menu.addSeparator();
            JMenu subMenu4 = new JMenu ("Culoare ");
            subMenu4.add(new StyledEditorKit.ForegroundAction("Rosu", Color.red));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Verde", Color.green));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Albastru", Color.blue));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Galben", Color.yellow));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Gri", Color.gray));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Gri inchis", Color.darkGray));
            subMenu4.add(new StyledEditorKit.ForegroundAction("Negru", Color.black));
            menu.add(subMenu4);
            return menu;
        protected JMenu createAjutorMenu() {
             JMenu menu = new JMenu("Ajutor");
            menu.setMnemonic(KeyEvent.VK_J);
            return menu;
        private void createActionTable(JTextComponent textComponent) {
            actions = new HashMap<Object, Action>();
            Action[] actionsArray = textComponent.getActions();
            for (int i = 0; i < actionsArray.length; i++) {
                Action a = actionsArray;
    actions.put(a.getValue(Action.NAME), a);
    private Action getActionByName(String name) {
    return actions.get(name);
    class UndoAction extends AbstractAction {
    public UndoAction() {
    super("Undo");
    setEnabled(false);
    public void actionPerformed(ActionEvent e) {
    try {
    undo.undo();
    } catch (CannotUndoException ex) {
    System.out.println("Unable to undo: " + ex);
    ex.printStackTrace();
    updateUndoState();
    redoAction.updateRedoState();
    protected void updateUndoState() {
    if (undo.canUndo()) {
    setEnabled(true);
    putValue(Action.NAME, undo.getUndoPresentationName());
    } else {
    setEnabled(false);
    putValue(Action.NAME, "Undo");
    class RedoAction extends AbstractAction {
    public RedoAction() {
    super("Redo");
    setEnabled(false);
    public void actionPerformed(ActionEvent e) {
    try {
    undo.redo();
    } catch (CannotRedoException ex) {
    System.out.println("Unable to redo: " + ex);
    ex.printStackTrace();
    updateRedoState();
    undoAction.updateUndoState();
    protected void updateRedoState() {
    if (undo.canRedo()) {
    setEnabled(true);
    putValue(Action.NAME, undo.getRedoPresentationName());
    } else {
    setEnabled(false);
    putValue(Action.NAME, "Redo");
    private static void createAndShowGUI() {
    final TextComponentDemo frame = new TextComponentDemo();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    UIManager.put("swing.boldMetal", Boolean.FALSE);
         createAndShowGUI();
    class JavaFilter extends javax.swing.filechooser.FileFilter
    public boolean accept (File f) {
    return f.getName ().toLowerCase ().endsWith (".txt")
    || f.isDirectory ();
    public String getDescription () {
    return "Fisiere text (*.txt)";

    Hi,
    unfortunatly you cannot change the properties of Action object as you would do with JavaBeans. Instead you have to use the 'put' method.
    eg.:
    myAction.put(Action.SMALL_ICON, new ImageIcon(...));IMHO this was a bad decision, because it's not like the JavaBeans standard and you loose static type information. :-/
    -Puce
    Message was edited by:
    Puce

  • Add menu item or icon to PA30

    Hello,
    Is it possible to add a menu item or an icon in the toolbar to add your own functionality to transaction PA30? I am trying enhancement PBAS0002 but I don't think that's it...
    Gr,
    Jaron Frenk

    Hi Jeron,
    Depends on what you want to do.  To change icons, you can use SE51-Screen Painter if you have a Developer Key.  Adding new tabs and and infotypes to those tabs is simple configuration - IMG: Personnel Management --> Customizing Procedures --> Infotype Menus --> Infotype Menu --> Infotype Menu.  Here you set up which infotypes appear on which tabs.  In the second step Determine Choice of Infotype Menu, you define which tabs appear in PA30. 
    So the question is - What are you trying to accomplish in PA30?
    Paul

  • I want to get rid of the Bing screen but there is no "menu at the top of the Firefox window" for me to "select Tools and then select the Add-ons menu item. "

    I suddenly have a "Bing" screen when I sign onto Firefox---and I want to get rid of it. The support section of Firefox says
    1. "From the menu at the top of the Firefox window, seledt Tools and then select the Add-ons menu item."---but I see no "menu item" nor Tools, much less Add-ons.
    2. "In the Add-ons window, click on the Extensions panel."---but how do I find the Add-ons window?
    3. Find the Bing Bar and Search Helper Extension in the list and click Disable for each of them."---but what and where exactly is that?
    At the top of the screen is only a Yahoo icon on the left and to the right of it a search box, "Web Search,", "My Apps," Yellow Pages," "Weather," "Updates," and "Skype." to the right of those there is a green cross saying "Add more apps. to your toolbar" and to the right of that a sort of gear shift looking icon saying "toobar settings."
    So, in short, how do I get rid of the Bing screen and how do I access those Tools?
    Thanks.

    To get rid of Bing Search Window..............
    Click on View tab / Tools and un-check 'Search' (alias for 'Bing')

  • Unable to create Menu Item List Buttons in Forms - Not Working!

    Hi guys,
    I need desperate help since I have been stuck on these for 2 days and I am unable to move forward!!
    I am trying to create a pdf form using Acrobat pro 9 and Adobe LiveCycle Designer ES. Since I am new to this, I have been browsing through numerous sites, forums and tutorials to learn about this. So far, I was able to create the forum with text fields, etc.. I am trying to have a column in my pdf form where the users can simply copy & paste image icons here..I was having difficulty with this already and have done numerous searches in google. In the end, I thought I am better off trying to use the "stamp" tool for this instead of image field. So this is what I did:
    1) I already placed the image icons (that the users will be copying & pasting) on my pdfs so users can simply click on it to select the image.
    2) I added a new bottom to this form which has the short cut to the menu item "copy" function. I labeled this button as 'Copy' and to this button, I added the following javascript for "Mouseup":
    app.execMenuItem("CopyFileToClipboard");
    3) Next I created another button that I called 'paste' and this button executes the "Paste Clipboard Image as Stamp Tool" menu. This button has the following javascript:
    app.execMenuItem("Annots:Tool:StampFromClipboardMenuItem");
    I thought that after doing the above, the user should be able to click on one of the images in the pdf, then click on 'copy' button and in the end click on 'paste' button that will then run an action so user can stamp this copied image to where ever they want in that file. But this is not happening!! I dont why?? Nothing happens when these buttons are clicked. I have made sure that the "Extended features in Adobe Reader..." is enabled and also tried running the above javascripts on my console window to test it and i know that the actual javascript code is not at fault since these functions works when I try the code through the debugger window. But I just cannot figure out why these menu item functions are not working when the buttons I had created are clicked!!! I dont know if what I have done is correct or if there is a easier way to achieve what I am trying to do!! Its a shame there is no simpler way for the end-users to copy and paste images to the columns in the pdf forms.
    please help me understand why the above button are not working....any help will be great!!

    Hi Paul,
    This is further to our email correspondence. I am just pasting your email response here since it may be useful to other newbies like me:
    "Ok here you go ......I had to add the new row via a script object as the new objects are not completely available until the script ends so I cannot resize the new row from teh current script.
    Then when we resize - we have to resize the row, the cells and the image ....we start with all existing subforms then we do it for the new row that was just added.
    Lastly I see that you have a delete row button. This will have to be part of the row otherwise we ill not know which row the user will want to delete .....unless you ask them (which is not good UI design)."
    I was really impressed the way you modified the script so the table height does not change when new rows are added. That did help me in understanding the methods and it will certainly be v useful to me in the future. I have been practicing and getting a hang of LS and I have actually decided to redesigned my form since it appears that trying to have a fixed table height is quite a bit of work each time a row is added, removed or changed, etc... Your advise so far have been v helpful and it has helped me in redesigned the form into a different layout. So far so good...However, I just have a few more clarifications regarding some hurdles I am facing:
    PS: I have emailed you a sample of my new form now so you can have a look at it.
    1) Dynamic Image fields:
    In this form, I have a subform that has a dropdown list and next to this, I have an image field. I want to change the image based on the selection in the dropdown list. I found a few samples and tutorials on this already and I tried 2 different approach for this. One works and the other doesnt.
    Method that works: What I have done here is, I added all the images in the form and have put their presence to invisible. Then using the javascript, I am making the image visible based on the selection in the dropdown list. I found this method somewhere through googling and it works.
    Method that doesnt work: Its similar to the above, but instead of putting all the images in the form, I just inserted 1 image field and then tried to change the url of this dynamic image based on the selection in the drop down list. But this method is not working. I tried inserting this jscript and nothing happens:
    switch (this.rawValue)
    case "1":
    myImages.value.Image.href=http://www.mysiteaddress.com/blah_blah.jpg;
    break;
    case "2":
    myImages.value.Image.href=http://www.mysiteaddress.com/blah_blah2.jpg;
    break;
    The 2nd method does not work. Although I know the method 1 above works and I am currently using it, I am just curious to find out why the 2nd method is not working? Did I get the script wrong or is this feature no longer allowed? I just thought that if the second method works fine, it saves the hassle of putting all the images on the form and then making them hidden. Instead, I just need to put one image field and then dynamically change its image based on the selection. I hope this make sense..please advise..
    2) Changing the background colour of the Dropdown list box:
    I am trying to change the bg colour of the listbox in the dropdown list object (only the listbox bg color and not the whole background color). So, I added the following script to the mouseEnter event and this works:
    var vName = this.somExpression;
    var fieldObj = xfa.resolveNode(vName + ".ui.#choiceList.border.fill.color");
    fieldObj.value = "255,255,225";
    My Problem: The above script works so I dont need to change anything there. But, I also want to add another script to the mouseExit event to change the fill color to its default once the mouse leaves the dropdown lists. Initially, this field has no fill colour and the border fill style is none. The fill color is only added during the mouseEnter event. How do I change the bg color fill back to none during mouseExit after the above script is executed on mouseEnter?
    (NOTE: If you see my form, I have used the above scripts for the dropdown list only in "boxSubform[0]".)
    3) Changing the length of the Dropdown List box:
    I only have about 1.6 inches workspace to add this dropdown list box. However, the length of some lists (list items) in this dropdown list box is actually longer and the remaining part is cut out. So, I added the following script to increase the dropdownlist length and it does not work the way I would have hoped...
    The script I have written so far:
    I added these to the mouseEnter event and it works fine -
    form1.pageSubform.dynamicSubform.Table1.Row1.boxSubform[0].MyDropdown::mouseEnter - (JavaScript, client)
    this.w = "2in";  //this is to to increase the width of the dropdown list
    I added these to the mouseExit event and it works fine too-
    form1.pageSubform.dynamicSubform.Table1.Row1.boxSubform[0].MyDropdown::mouseExit - (JavaScript, client)
    this.w = "1.625in";
    When I tested the form with the above script, this is what happens:
    1) First when you move the mouse over this field, the width increases. Similarly the width decreased when you move away.
    2) So, even if this is clicked, the list box is opened with this 2inch width so thats good.
    3) There are no problems when the mouse is moved over these list items as well. However, this does not look good when the dropdown list item is clicked with its item lists open and then the mouse leaves this area. In this case, as soon as the mouse leaves this area, the mouseExit script runs and hence it makes the drop down list width to shrink eventhough the list items are still open. How do I resolve this? I was thinking about this and I thought the possible way to overcome this is by writing a javascript for the mouseExit event executing something like this:
    if this dropdown list is open,
    then  this.w = "2in";
    else
    this.w = "1.625in";
    I am not sure how to write a jscript for the above?
    (NOTE: If you see my form, I have used the above scripts for the dropdown list in "boxSubform[0]".)
    4) Hiding the alternative row shadowing for hidden columns:
    If you check out my form, you can notice that I have put the "close" button (button to delete table rows) on the left column and I have also put its presence to "Visible (screen only)". The parent table has got the 'alternative row shadow' checked. What I notice here is, when this page is printed, eventhough the first column's presence is set to "Visible (Screen Only)", it still prints the row shadow for this column and it looks bad. How can I fix this? Any help will be great!
    I have already emailed you my new form again so you can have a look.
    Thanks again Paul and I cant thank you enough for your help. I am sooo happy to see such a great support and resources available here since it can be a nightmare for some newbies like me... :-)

  • How to change the default position of context menu item? (C#)

    Hi,
    I have included a calendar context menu item with my Outlook Addin. But by default, its positioned at the last as shown in the picture below:
    I need a way to make it as the fourth item instead of last one. Also, I want set an icon for the same. How can I do that?
    Appreciate if you can give some sample examples.
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    The
    Customizing Context Menus in Office 2010 article in MSDN describes the basics.
    You can specify the IdMso value of the built-in control after/before you need to insert your own:
    <button id="MyBtn" label="MyButton" insertBeforeMso="OpenSelectedItems" />
    See
    Office 2013 Help Files: Office Fluent User Interface Control Identifiers 
    for IdMso values.

  • Why is my creative cloud app on windows 8.1 blank, no menu items.

    I have a Dell XPS 15 laptop running windows 8.1 When I run the creative cloud app, all I get is a blank window, with no menu items. How can I fix this?

    Quit Creative Cloud application .
    End Adobe related tasks like Creative Cloud , CoreSync, AAMUpdater...etc from Task Manager.
    1) Right click on Finder icon and  select "Go-To" Folder option.
      2) You will get a text box, type-in below command and then hit 'Return' key.( Do not miss ~ symbol)
    ~/library
    3)Then navigate to Application Support>Adobe>OOBE. Open OOBE folder and delete opm file.
    Once you had deleted opm.db file.
    Disable Anti-Virus and Firewall temporarily .
    Then launch Creative Cloud app and check.

  • Help menu items not available Logic Pro 9

    I think this problem occured after upgrading to Mavericks. When I use the help menu in LogicPro9 and click on the most relevant keywords that I have typed I am presented with a dialog that indicates: "The selected topic is currently unavailable. The topic you were trying to view could not be found."
    I think this may be related to Spotlight not being indexed properly. After having problems re-indexing Spotlight I finally realised that in order for Spotlight to re-index correctly I had to add my permanently installed SD card to the Spotlight Privacy eclusion list. Instead of Spotlight taking 5+ hours to re-index a fast SSD it now did it in about 10mins.
    I am now confident Spotlight has re-indexed successfully.
    But the help menu items are still "unavailable"
    OSX 10.9.1
    MacBookPro Mid 2012
    Logic Pro 9.1.8

    I'm still putting this question out there to anyone who can help solve this problem. After trashing the Logic Pro9 App from the Finder>Applications I visited the Mac App Store and under the Purchases icon I re-installed Logic Pro9.
    The Help menu is still returning:
    "The topic you were trying to view could not be found." when clicking on the suggested returned results in relation to my search keywords.
    I know there are better resources out there but I find it handy to use the help menu instead of reaching for a book or website/weblink.
    Eventually I will switch to Logic Pro X but as Lennar Digital is still finalising their 64Bit version release of Sylenth (popular soft synth)  I will wait until that is completed later in the year.

  • Menu item appears multiple items

    I've created a menu item for the extension I'm working on; however, it is showing up 4 times in the Tools menu instead of just once. I've looked at various tutorials on the subject,but I can't seem to find what I've done incorrectly.
    VSCT File
    <?xml version="1.0" encoding="utf-8"?>
    <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <Extern href="stdidcmd.h"/>
    <Extern href="vsshlids.h"/>
    <Commands package="guidTemplatePackPkg">
    <Groups>
    <Group guid="guidTemplatePackCmdSet" id="MyMenuGroup" priority="0x0600">
    <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
    </Group>
    </Groups>
    <Buttons>
    <Button guid="guidTemplatePackCmdSet" id="cmdidMyCommand" priority="0x2000" type="Button">
    <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD_REFERENCES" />
    <CommandFlag>DynamicVisibility</CommandFlag>
    <CommandFlag>DefaultInvisible</CommandFlag>
    <Strings>
    <CommandName>AddSideWaffleProject</CommandName>
    <ButtonText>Add Template Reference (SideWaffle project)</ButtonText>
    </Strings>
    </Button>
    </Buttons>
    </Commands>
    <!-- SideWaffle Menu Options -->
    <Commands package="guidMenuOptionsPkg">
    <Groups>
    <Group guid="guidMenuOptionsCmdSet" id="SWMenuGroup" priority="0x0600">
    <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
    </Group>
    </Groups>
    <Buttons>
    <Button guid="guidMenuOptionsCmdSet" id="cmdidOpenSWMenu" priority="0x0100" type="Button">
    <Parent guid="guidMenuOptionsCmdSet" id="SWMenuGroup" />
    <Icon guid="guidImages" id="bmpPic1" />
    <Strings>
    <ButtonText>SideWaffle Settings</ButtonText>
    </Strings>
    </Button>
    </Buttons>
    <Bitmaps>
    <Bitmap guid="guidImages" href="Resources\Images.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/>
    </Bitmaps>
    </Commands>
    <!-- End SideWaffle Menu Options -->
    <Symbols>
    <GuidSymbol name="guidTemplatePackPkg" value="{e6e2a48e-387d-4af2-9072-86a5276da6d4}" />
    <GuidSymbol name="guidTemplatePackCmdSet" value="{a94bef1a-053e-4066-a851-16e5f6c915f1}">
    <IDSymbol name="MyMenuGroup" value="0x1020" />
    <IDSymbol name="cmdidMyCommand" value="0x0100" />
    </GuidSymbol>
    <!-- SideWaffle Menu Options -->
    <GuidSymbol name="guidMenuOptionsPkg" value="{796B8CBC-3010-4A76-872B-56775129765F}" />
    <GuidSymbol name="guidMenuOptionsCmdSet" value="{13EE92AE-B8B5-4728-8AF6-F53D8DD9C391}">
    <IDSymbol name="SWMenuGroup" value="0x1020" />
    <IDSymbol name="cmdidOpenSWMenu" value="0x0100" />
    </GuidSymbol>
    <GuidSymbol name="guidImages" value="{900524C9-8677-4F84-AF97-3A1B5B45E3B2}" >
    <IDSymbol name="bmpPic1" value="1" />
    <IDSymbol name="bmpPic2" value="2" />
    <IDSymbol name="bmpPicSearch" value="3" />
    <IDSymbol name="bmpPicX" value="4" />
    <IDSymbol name="bmpPicArrows" value="5" />
    <IDSymbol name="bmpPicStrikethrough" value="6" />
    </GuidSymbol>
    <!-- End SideWaffle Menu Options -->
    </Symbols>
    </CommandTable>
    TemplatePackage.cs
    using EnvDTE;
    using EnvDTE80;
    using Microsoft.VisualStudio.Shell;
    using Microsoft.VisualStudio.Shell.Interop;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.Design;
    using System.Linq;
    using System.Runtime.InteropServices;
    using TemplatePack.Tooling;
    namespace TemplatePack
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(GuidList.guidTemplatePackPkgString)]
    [ProvideAutoLoad(UIContextGuids80.SolutionExists)]
    public sealed class TemplatePackPackage : Package
    private DTE2 _dte;
    protected override void Initialize()
    base.Initialize();
    _dte = GetService(typeof(DTE)) as DTE2;
    OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
    if (null != mcs)
    CommandID cmdId = new CommandID(GuidList.guidTemplatePackCmdSet, (int)PkgCmdIDList.cmdidMyCommand);
    OleMenuCommand button = new OleMenuCommand(ButtonClicked, cmdId);
    button.BeforeQueryStatus += button_BeforeQueryStatus;
    mcs.AddCommand(button);
    /*if(Environment.GetEnvironmentVariable("SideWaffleEnableDynamicTemplates") != null)*/{
    try {
    new DynamicTemplateBuilder().ProcessTemplates();
    catch (Exception ex) {
    // todo: replace with logging or something
    System.Windows.MessageBox.Show(ex.ToString());
    void button_BeforeQueryStatus(object sender, EventArgs e)
    var button = (OleMenuCommand)sender;
    var project = GetSelectedProjects().ElementAt(0);
    // TODO: We should only show this if the target project has the TemplateBuilder NuGet pkg installed
    // or something similar to that.
    button.Visible = true;
    // button.Visible = project.IsWebProject();
    private void ButtonClicked(object sender, EventArgs e)
    Project currentProject = GetSelectedProjects().ElementAt(0);
    var projects = _dte.Solution.GetAllProjects();
    var names = from p in projects
    where p != currentProject
    select p.Name;
    ProjectSelector selector = new ProjectSelector(names);
    bool? isSelected = selector.ShowDialog();
    if (isSelected.HasValue && isSelected.Value)
    // need to save everything because we will directly write to the project file in the creator
    _dte.ExecuteCommand("File.SaveAll");
    TemplateReferenceCreator creator = new TemplateReferenceCreator();
    var selectedProject = projects.First(p => p.Name == selector.SelectedProjectName);
    creator.AddTemplateReference(currentProject, selectedProject);
    public IEnumerable<Project> GetSelectedProjects()
    var items = (Array)_dte.ToolWindows.SolutionExplorer.SelectedItems;
    foreach (UIHierarchyItem selItem in items)
    var item = selItem.Object as Project;
    if (item != null)
    yield return item;
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(GuidList.guidMenuOptionsPkgString)]
    [ProvideAutoLoad(UIContextGuids80.SolutionExists)]
    public sealed class MenuOptionsPackage : Package
    // Overridden Package Implementation
    #region Package Members
    protected override void Initialize()
    base.Initialize();
    // Add our command handlers for menu (commands must exist in the .vsct file)
    OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
    if ( null != mcs )
    // Create the command for the menu item.
    CommandID menuCommandID = new CommandID(GuidList.guidMenuOptionsCmdSet, (int)PkgCmdIDList.SWMenuGroup);
    OleMenuCommand menuItem = new OleMenuCommand(MenuItemCallback, menuCommandID );
    mcs.AddCommand( menuItem );
    #endregion
    private void MenuItemCallback(object sender, EventArgs e)
    // Here is where our UI (i.e. user control) will go to do all the settings.
    var window = new SettingsForm();
    window.Show();
    PackageConstants.cs
    // PkgCmdID.cs
    // MUST match PkgCmdID.h
    using System;
    namespace TemplatePack
    static class GuidList
    public const string guidTemplatePackPkgString = "e6e2a48e-387d-4af2-9072-86a5276da6d4";
    public const string guidTemplatePackCmdSetString = "a94bef1a-053e-4066-a851-16e5f6c915f1";
    public static readonly Guid guidTemplatePackCmdSet = new Guid(guidTemplatePackCmdSetString);
    // SideWaffle Remote Source Settings
    public const string guidMenuOptionsPkgString = "796B8CBC-3010-4A76-872B-56775129765F";
    public const string guidMenuOptionsCmdSetString = "13EE92AE-B8B5-4728-8AF6-F53D8DD9C391";
    public static readonly Guid guidMenuOptionsCmdSet = new Guid(guidMenuOptionsCmdSetString);
    static class PkgCmdIDList
    public const uint cmdidMyCommand = 0x100;
    public const uint SWMenuGroup = 0x100;
    I just can't seem to figure out what I might be doing wrong. Any suggestions?

    Already ahead of you on that one. Here's where I'm at
    VSCT File
    <?xml version="1.0" encoding="utf-8"?>
    <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <Extern href="stdidcmd.h"/>
    <Extern href="vsshlids.h"/>
    <Commands package="guidTemplatePackPkg">
    <Groups>
    <Group guid="guidTemplatePackCmdSet" id="MyMenuGroup" priority="0x0600">
    <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
    </Group>
    <Group guid="guidMenuOptionsCmdSet" id="SWMenuGroup" priority="0x0500">
    <Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>
    </Group>
    </Groups>
    <Buttons>
    <Button guid="guidMenuOptionsCmdSet" id="cmdiSWCommand" priority="0x1000" type="Button">
    <Parent guid="guidMenuOptionsCmdSet" id="SWMenuGroup" />
    <Icon guid="guidImages" id="bmpPic1" />
    <Strings>
    <CommandName>cmdidSWCommand</CommandName>
    <ButtonText>SideWaffle Settings</ButtonText>
    </Strings>
    </Button>
    <Button guid="guidTemplatePackCmdSet" id="cmdidMyCommand" priority="0x2000" type="Button">
    <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_PROJECT_ADD_REFERENCES" />
    <CommandFlag>DynamicVisibility</CommandFlag>
    <CommandFlag>DefaultInvisible</CommandFlag>
    <Strings>
    <CommandName>AddSideWaffleProject</CommandName>
    <ButtonText>Add Template Reference (SideWaffle project)</ButtonText>
    </Strings>
    </Button>
    </Buttons>
    <Bitmaps>
    <Bitmap guid="guidImages" href="Resources\Images.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/>
    </Bitmaps>
    </Commands>
    <Symbols>
    <GuidSymbol name="guidTemplatePackPkg" value="{e6e2a48e-387d-4af2-9072-86a5276da6d4}" />
    <GuidSymbol name="guidTemplatePackCmdSet" value="{a94bef1a-053e-4066-a851-16e5f6c915f1}">
    <IDSymbol name="MyMenuGroup" value="0x1020" />
    <IDSymbol name="cmdidMyCommand" value="0x0100" />
    </GuidSymbol>
    <GuidSymbol name="guidMenuOptionsCmdSet" value="{13EE92AE-B8B5-4728-8AF6-F53D8DD9C391}">
    <IDSymbol name="SWMenuGroup" value="0x1010" />
    <IDSymbol name="cmdidSWCommand" value="0x0090" />
    </GuidSymbol>
    <GuidSymbol name="guidImages" value="{900524C9-8677-4F84-AF97-3A1B5B45E3B2}" >
    <IDSymbol name="bmpPic1" value="1" />
    <IDSymbol name="bmpPic2" value="2" />
    <IDSymbol name="bmpPicSearch" value="3" />
    <IDSymbol name="bmpPicX" value="4" />
    <IDSymbol name="bmpPicArrows" value="5" />
    <IDSymbol name="bmpPicStrikethrough" value="6" />
    </GuidSymbol>
    </Symbols>
    </CommandTable>
    PackageConstants.cs
    // PkgCmdID.cs
    // MUST match PkgCmdID.h
    using System;
    namespace TemplatePack
    static class GuidList
    public const string guidTemplatePackPkgString = "e6e2a48e-387d-4af2-9072-86a5276da6d4";
    public const string guidTemplatePackCmdSetString = "a94bef1a-053e-4066-a851-16e5f6c915f1";
    public static readonly Guid guidTemplatePackCmdSet = new Guid(guidTemplatePackCmdSetString);
    // SideWaffle Remote Source Settings
    public const string guidMenuOptionsPkgString = "796B8CBC-3010-4A76-872B-56775129765F";
    public const string guidMenuOptionsCmdSetString = "13EE92AE-B8B5-4728-8AF6-F53D8DD9C391";
    public static readonly Guid guidMenuOptionsCmdSet = new Guid(guidMenuOptionsCmdSetString);
    static class PkgCmdIDList
    public const uint cmdidMyCommand = 0x100;
    public const uint cmdidSWCommand = 0x101;
    TemplatePackPackage.cs
    using System;
    using System.Linq;
    using System.Diagnostics;
    using System.Globalization;
    using System.Runtime.InteropServices;
    using System.ComponentModel.Design;
    using Microsoft.Win32;
    using Microsoft.VisualStudio;
    using Microsoft.VisualStudio.Shell.Interop;
    using Microsoft.VisualStudio.OLE.Interop;
    using Microsoft.VisualStudio.Shell;
    using System.Collections.Generic;
    using EnvDTE;
    using EnvDTE80;
    using LigerShark.Templates.DynamicBuilder;
    using TemplatePack.Tooling;
    namespace TemplatePack
    [PackageRegistration(UseManagedResourcesOnly = true)]
    [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
    [ProvideMenuResource("Menus.ctmenu", 1)]
    [Guid(GuidList.guidTemplatePackPkgString)]
    [ProvideAutoLoad(UIContextGuids80.SolutionExists)]
    public sealed class TemplatePackPackage : Package
    private DTE2 _dte;
    protected override void Initialize()
    base.Initialize();
    _dte = GetService(typeof(DTE)) as DTE2;
    OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
    if (null != mcs)
    CommandID cmdId = new CommandID(GuidList.guidTemplatePackCmdSet, (int)PkgCmdIDList.cmdidMyCommand);
    OleMenuCommand button = new OleMenuCommand(ButtonClicked, cmdId);
    button.BeforeQueryStatus += button_BeforeQueryStatus;
    mcs.AddCommand(button);
    CommandID menuCommandID = new CommandID(GuidList.guidMenuOptionsCmdSet, (int)PkgCmdIDList.cmdidSWCommand);
    MenuCommand menuItem = new MenuCommand(MenuItemCallback, menuCommandID);
    mcs.AddCommand(menuItem);
    /*if(Environment.GetEnvironmentVariable("SideWaffleEnableDynamicTemplates") != null)*/{
    try {
    new DynamicTemplateBuilder().ProcessTemplates();
    catch (Exception ex) {
    // todo: replace with logging or something
    System.Windows.MessageBox.Show(ex.ToString());
    void button_BeforeQueryStatus(object sender, EventArgs e)
    var button = (OleMenuCommand)sender;
    var project = GetSelectedProjects().ElementAt(0);
    // TODO: We should only show this if the target project has the TemplateBuilder NuGet pkg installed
    // or something similar to that.
    button.Visible = true;
    // button.Visible = project.IsWebProject();
    private void ButtonClicked(object sender, EventArgs e)
    Project currentProject = GetSelectedProjects().ElementAt(0);
    var projects = _dte.Solution.GetAllProjects();
    var names = from p in projects
    where p != currentProject
    select p.Name;
    ProjectSelector selector = new ProjectSelector(names);
    bool? isSelected = selector.ShowDialog();
    if (isSelected.HasValue && isSelected.Value)
    // need to save everything because we will directly write to the project file in the creator
    _dte.ExecuteCommand("File.SaveAll");
    TemplateReferenceCreator creator = new TemplateReferenceCreator();
    var selectedProject = projects.First(p => p.Name == selector.SelectedProjectName);
    creator.AddTemplateReference(currentProject, selectedProject);
    public IEnumerable<Project> GetSelectedProjects()
    var items = (Array)_dte.ToolWindows.SolutionExplorer.SelectedItems;
    foreach (UIHierarchyItem selItem in items)
    var item = selItem.Object as Project;
    if (item != null)
    yield return item;
    private void MenuItemCallback(object sender, EventArgs e)
    // Here is where our UI (i.e. user control) will go to do all the settings.
    var window = new SettingsForm();
    window.Show();
    Once I removed the second package it no longer appeared multiple times in the Tools menu; however, when I click the button the SettingsForm is not being opened.

Maybe you are looking for

  • HP CUE-Scanni​ng Flow Component has stopped working on printer settings

    Hello, When i click Printer Settings or when i am done with scan and need to send it to printer i got: HP CUE-Scanning Flow Component has stopped working error. Specifications of system are below. OS: Windows 7 Scanner: HP ScanJet G2400 (System sayin

  • Alpha numeric page numbers

    I would like to number pages using letters and numbers. When I put a number in for section and a letter in for sub-section, I get a message that the sub-section has to be a number. I have tried different variations with volume, chapter, section...ect

  • Podcast app disappeared in iOS 8 on iPhone 5

    Since I've updated to iOS 8 (now iOS 8.1) the Apple Podcast app have disappeared. It cannot be found or downloaded from Appstore on my iPhone 5. I'have tried installing it from iTunes on my MacBook, but that doesn't work either. How do get Apple Podc

  • Ejecting ipod from the pc

    here is what my pc states when i try to discconnect: the ipod cannot be ejected beacuse it contains files that are in use by another application. steps i took 1-safely remove hardware(results no good) 2-ejecting from i tunes(results no good) 3-going

  • TS2446 Security questions and answers

    How long does it take for security questions and answers to be updated once you change them?