Using TreeViewer and creating a pop-up menu?

I am using Eclipse Ganymede(3.1?) to write my program. This project has multiple parts(most issues/progress can be tracked back in java-forums.org) and I am trying to get the last bit of my GUI finished. I have a TreeViewer that displays on top of a composite display(not a component) which is why I haven't been able to find a solution that works for me. My tree is interactive(double click nodes to expand, deepest nodes open up an editor view, auto refresh new nodes/deletes etc) and I'm trying to make a pop-up menu appear on right click that would give all the options the File menu gives. I haven't been able to find a work around on how to attach the menu since my TreeViewer is based on a composite instead of a component there is no where to attach the menu. I have been working on this one issue for a week with no progress and am at the point where I'm tempted to rewrite my entire project using JPanel and JPanes and Tree but I REALLY don't want to have to do this. This is my createPartControl method with the relevent sections.
public void createPartControl(final Composite parent) {
//          final Tree tree = new Tree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
          treeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
//          treeViewer = new TreeViewer(tree);
          treeViewer.setContentProvider(new ViewContentProvider());
          treeViewer.setLabelProvider(new ViewLabelProvider());
          treeViewer.setInput(createDummyModel());
//Double click listener
          treeViewer.addOpenListener(new IOpenListener() {
               public void open(final OpenEvent event) {
                    //double click expands/shrinks nodes, opens up target editors
//Selection listener
          treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
                  public void selectionChanged(SelectionChangedEvent event) {
                       final IActionBars bars = getViewSite().getActionBars();
                       selObj = ((IStructuredSelection) event.getSelection()).getFirstElement();                      
                                  //...outputs selection to status bar
//Mouse listener
          treeViewer.getTree().addMouseListener(new MouseAdapter(){
             public void mouseUp(MouseEvent event){
                  if(event.button==3){         //right click
                       System.out.println(event.getSource());        //Tree{ }
                       System.out.println(event.display);             //org.eclipse.swt.widgets.Display@1e328e0
                       if(selObj instanceof Server){
                            System.out.println(treeViewer.getControl().toString());          //Same as event.getSource()
                                           /*code to have menu appear goes here*/
                            System.out.println("Server Menu");
                            //Delete Server
                            //Edit Server
                            //View Properties
     }Does anybody know a way I can attach a popup menu to the node I click on or if it's possible(and if so how would I go about) attaching it to the display beneath the TreeViewer and somehow setting the focus or making the popup a heavy component so it would appear on top?
P.S there's alot more superfluous code in the listeners but they don't pertain to this so I removed them.

Can anyone confirm that what I'm trying to do is not possible? I found this link which states an SWT bug of the header not being a control so it become unattachable. http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg38040.html
Any truth in this and if so where can I track progress of the bug?

Similar Messages

  • How to create a Pop-up menu for an Applet

    I need to create a Pop-up menu that works like this:
    When the user move his mouse over the applet, the menu will pop up, extending beyond the bounds of the applet.
    In other words: The applet will display only the menu headings - a mouse-over should cascade a menu beneath the heading - once again: beyond the bounds of the applet.
    (Hopefully, the end result will look and work pretty much like a DHTML menu that uses <div>'s.)
    I thought of popping up a JFrame to act as the menu - however, the JFrame has its own title bar.
    Any ideas!?

    OK - I tried using a JMenuBar - and it does cascade out of the Applet box. The question is:
    How do I close the menu without clicking on the Applet box? - i.e. if the user clicks on the web-page, or simply waits a second or 2, the menu should collapse?
    Any ideas?

  • Looking for a way to create a pop-up menu with two sub-layers

    I'm looking for a solution in Fireworks CS3: creating a
    pop-up menu which goes two deep instead of the standard one-deep.
    TOP LEVEL > SECOND LEVEL > THIRD LEVEL
    Does anyone know if this is possible?
    Thanks!

    http://www.projectseven.com/
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "Jim Babbage .:CMX:. & .:Adobe Community Expert:."
    <[email protected]> wrote in message
    news:ga4amp$4ci$[email protected]..
    > paulkirtley wrote:
    >> I'm looking for a solution in Fireworks CS3:
    creating a pop-up menu
    >> which goes two deep instead of the standard
    one-deep. TOP LEVEL >
    >> SECOND LEVEL > THIRD LEVEL
    >>
    >> Does anyone know if this is possible?
    >>
    >> Thanks!
    >>
    > Please don't so this in FW. FW is primarily a web
    graphics and prototyping
    > tool, not a web page creator. There are better options
    out there, both
    > free and commercial.
    >
    > Check out Project Seven for several options in this
    area.
    >
    > --
    > Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    >
    http://www.communityMX.com/
    > CommunityMX - Free Resources:
    >
    http://www.communitymx.com/free.cfm
    > ---
    > .:Adobe Community Expert for Fireworks:.
    > Adobe Community Expert
    >
    http://tinyurl.com/2a7dyp
    > ---
    > See my work on Flickr
    >
    http://www.flickr.com/photos/jim_babbage/

  • How to create a pop up menu or option in labview?

    Hi to all,
    Just want to ask, how do u create a pop up menu? when you click on a certain button, another view or option would appear like series of texts or instructions. thanks again. thanks 

    jmvrd wrote:
    Also, how can i create a play button? a button that will run the whole program instead pressing the run mode itself. thanks
    You don't actually create a play button. You need to create an architecture that has your program idle until something happens. A while loop with an event structure within it will do that. See the "Login dialog" example that ships with LabVIEW for an example of how to use an event structure. Depending on how complex you need your program to be, you may need to look into using a state machine, master-slave, or producer-consumer architecture.

  • Pixelated and barely readable pop-up menu.

    I created a Blu-ray pop-up menu using Photoshop which looks like this:
    I burned the project on a 25GB Blu-ray disc and when I play it on my Playstation 3 it looks like this:
    As you can see, the buttons get really ugly, pixelated and barely readable, while in Encore they look good.
    Why do they look so ugly after I burned it?
    I would really appreciate your help!

    Ok,
    you're converting a standard video to a BlueRay one (thanks Bill ).
    I supposed that you set 720x576 as project pixel rate
    Resizing is sometimes a very hard work and results are not what you expected.
    Pixel rate should ever be the same for movie as well as menu..
    If your converted video is ok, I suggest you to create a menu with the same pixel rate of your BD project and no with a different definition to be resized.
    So leave your 720x480 and create a menu with same dimension of your final BR project.
    This will be better.
    Hope this will help
    Ciao
    Giorgio

  • How can I use undo and redo with run time menu?

    Hi..I try to built my own menu for graphic programming. How can I use undo and redo in labview with run time menu?

    filozof-
    During runtime, by default, LabVIEW has undo/redo data changes under the edit menu. This will undo/redo changes made to controls during runtime. If you want a more extensive undo/redo (custom for your application), you are going to have to do quite a few things
    1) Create a custom runtime menu (Edit>>RunTime Menu) and place your own undo/redo controls on it
    2) Keep an action history in your program
    3) Catch the Shortcut menu event for your custom undo/redo controls
    4) Reverse the last action in your histroy when you catch the event
    This method would allow you undo entire operations (like resize, move, or whatever kind of functionality you are building into your application) unstead of just undoing data changes.
    Xaq

  • Using COUNTIF formula using controlled data in cell pop-up menu

    I'm making a spread sheet that involves adding up the number of times a certain item occurs in a log. A pop-up menu is used in the cell to control the inputs of the log. I'm not sure how to go about using the COUNTIF function to count the number of times each item occurs. The "workout tracker" template in Numbers '09 does what I need to do when counting the "number of days exercised", but I don't understand how it was done. Can anyone explain this to me?
    My log table is: (Dashes denote spacing)
    Date---------Log Item-----Time
    01/03/09---Item 1-------9:00am
    02/03/09---Item 2-------12:15pm
    03/03/09---Item 3-------9:10am
    (you can only chose Item 1, 2 or 3 from a drop down list, you can't manually input anything else)
    I want to use a countif command for a table that is:
    -----------No. of Occurances
    Item 1-------1
    Item 2-------1
    Item 3-------1

    I'm guessing you are curious about the way they did COUNTIF and what "Indicator" is. If you unhide all columns in the Workouts table, you'll see a column D with the header "indicator". The reference to "Indicator" in the COUNTIF functions refers to the entire column. There is a fairly long formula in the cells of that column but, basically, it just populates it with 1-3 depending on what you pick in the Activity popup.

  • Is it possible to create a pop-up menu with sub-headings

    I am trying to setup a pop-up menu in Number that would give me the ability to first create subheadings, that I can then enter my selection list in.
    Example:
    Subheading 1
         eg 1
         eg 2
         eg 3
    Subheading 2
         eg 1
         eg 2
         eg 3
    Subheading 3
         eg 1
         eg 2
         eg 3
    I did try to search for a solution to this, but nothing came up that I recognized quickly.  So, I'm hopeful that someone out there in the Apple community has a quick work-around for acomplishing this.
    Thanks,

    Strictly speaking this i not possible.  You could precede each entry that is indented with a space to make the menu appead to have sub entries.

  • Mail doesn't put relevant conversations into a conversation. Could this be due to using hotmail and therefore a POP server?

    I recently downloaded Lion and was wondering why the conversations in mac mail wasn't working properly. My relpy to the message goes into the conversation, but then the reply from the other person opens as a new message not in the same conversation. Is there a setting I am unaware of?
    Could this be becasue I use hotmail and a pop server?

    No, this is because Mail is programmed with rigid, inappropriate rules for grouping messages in conversations. There are no settings that can modify either the rules for grouping or the grouping after applying the rules.  Mail  thinks it's smarter than you are and won't listen to any arguments to the contrary.

  • HT1386 I am unable to get a two way calendar sync with my iPhone 4s and my mac's ical.  iTunes syncs my mac's calendar to the phone, but not the other way.  I do not use iCloud and I cannot find any menu for removing sync history as described by others.

    I have spent 3 hours trying to get my ical updated on my mac with events added to my iphone calendar. Itunes will sync the calendars from the mac to the phone, but not vice versa.  I have read every post which relates to this problem, but I do not use iCloud, there is no iSync app on my mac, and there is no menu to delete sync history under system preferences.  My mac is fairly new and is running Mac OS X 10.7.4.   I tried to delete the iphone from itunes and start over, but can't even do that.   Now what?  Any advice short of throwing both devices out the window?

    For resetting the sync history on a Mac running Lion - 10.7.x if needed.
    http://support.apple.com/kb/TS1627
    If you see the Sync menu in the menu bar, skip to step 3: 
    If you do not see the Sync menu in your menu bar, skip to step 7.
    Hold the Option key on your keyboard, then click the Sync menu in the menu bar:   
    if you see the Sync menu but you are unable to open it, skip to step 8.
    Choose Reset Sync Services.
    Click Reset Sync History.
    Test for the original issue. If the issue persists, or if you are unable to open the Sync menu, follow these steps:
    In the Finder, choose Utilities from the Go menu.
    Open Terminal.
    In the Terminal window, type or paste the following command on a single line:
    /System/Library/Frameworks/SyncServices.framework/Versions/A/Resources/resetsync .pl full
    Press Return.
    Quit Terminal after the operation has completed (when Terminal returns to the command prompt with a $).

  • Error while trying to use Ant and creating Jdbc Datasource

    I was following the documentation to auto-create my datasource in my weblogic server. I get an error while it is trying to link the datasource to the server. Does anybody have any ideas,it is almost like the query to get the server isn't working.
    Here is my ant task:
    <target name="setupJdbcDatasource">
         <wlconfig url="t3://localhost:7001" username="weblogic" password="weblogic">
         <query domain="MyDomain" type="Server" name="AdminServer" property="adminserver"/>
         <create type="JDBCConnectionPool" name="TestDatasource" property="DatasourceTest">
              <set attribute="CapacityIncrement" value="1"/>
              <set attribute="DriverName" value="weblogic.jdbcx.oracle.OracleDataSource"/>
              <set attribute="InitialCapacity" value="1"/>
              <set attribute="MaxCapacity" value="10"/>
              <set attribute="Password" value="cmuser"/>
              <set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
              <set attribute="RefreshMinutes" value="0"/>
              <set attribute="ShrinkPeriodMinutes" value="15"/>
              <set attribute="ShrinkingEnabled" value="true"/>
              <set attribute="TestConnectionsOnRelease" value="false"/>
              <set attribute="TestConnectionsOnReserve" value="false"/>
              <set attribute="URL" value="jdbc:bea:oracle://10.13.5.144:1521"/>
              <set attribute="Targets" value="${adminserver}"/>
         </create>
         </wlconfig>
    </target>
    My Domain is MyDomain, and server is AdminServer. The error I get is:
    [wlconfig] weblogic.management.DistributedManagementException : Distributed Management [1 exceptions]
    BUILD FAILED
    X:\ibutt_PCView\src\CM\build.xml:285: Error invoking MBean
    command: javax.management.MBeanException
    And in my server log:
    jdbcDataSourceBean=[MBeanServerInvocationHandler]com.bea:Name=CP-ConfigManagemen
    tTest,Type=weblogic.j2ee.descriptor.wl.JDBCDataSourceBean,Parent=[MyDomain]/JDBC
    SystemResources[CP-ConfigManagementTest],Path=JDBCResource
    <May 21, 2006 3:50:57 PM EDT> <Warning> <JDBC> <BEA-001129> <Received exception
    while creating connection for pool "ConfigManagementTest": [BEA][Oracle JDBC Dri
    ver]Missing connection information: no serverName specified.>
    <May 21, 2006 3:50:58 PM EDT> <Error> <Deployer> <BEA-149265> <Failure occured i
    n the execution of deployment request with ID '1148241051441' for task 'weblogic
    .deploy.configChangeTask.2'. Error is: 'weblogic.application.ModuleException: '
    weblogic.application.ModuleException:

    Hi. This seems like an XML parsing problem.
    Could you please try changing the driver
    properties from:
    <set attribute="Properties" value="user=cmuser SID=ORCH serverName=10.13.5.144 portNumber=1521"/>
    to:
    <set attribute="Properties" value="user=cmuser SID=ORCH"/>
    The server and port are already in the URL
    thanks,
    Joe

  • How to filter xml using dtd and create a new xml document

    Good morning my name is Antonio and I'm an italian programmer.
    I need an help about the follow question.
    I want to filter the contents of a XML document using a DTD to allow
    only the valid elements and attributes as specified in the DTD to be
    passed through to the output, any data that does not conform to the DTD
    should be filtered out.
    To resolve this problem there's XML Translator Generator (XTransGen): http://www.alphaworks.ibm.com/tech/xmltranslatorgenerator
    but at moment it's not avaiable.
    Can you help me?
    Many thanks.
    ciao
    Antonio

    ...

  • What i need to convert serbian cyrilic document in word. OS 10.9.4 is german and in OCR-pop up menue ar no cyrilic language!

    ineed help to konvert serbian cyrilic or serban lateen pdf-document in same script in word!

    Convert how: using Acrobat, or the ExportPDF online service?

  • Using a conditional pop-up menu for creating an order form...

    I am trying to create an order form on Numbers (version 2.0.1) using my iPad. My idea is to create a pop-up menu that would contain a number of products (about 50 or so). I'd copy this pop-up menu on all the cells in the column under "Description". That part is no problem. BUT ... ideally when a product is selected from the pop-up menu, I would like for its price to automatically populate the corresponding cell under "Unit Price". Obviously the various products will have various prices. For example, I might have three products listed as "Assorted Miniatures" which cost $5 each; "Animal Pot" which costs $10; and "Geometric Pot" which costs $15. Can this be done???
    If and when that is accomplished, then I presume I can easily apply the basic formulas to get total amounts. All of this means that once completed the only thing I really need to do is select products and then all the pricing and total amounts are automatically listed and calculated. Can someone assist? I have a show coming up this weekend and I hope to fill out lots of order forms!!! :-)  Thank you!!!

    MicMac22,
    Here is my take. Lookup table as Wayne suggests.
    Popup menu is a great idea.
    description
    quant
    unit price
    total Amt
    Item 2
    $2.00
    Item 1
    $1.00
    My entry table would look like yours.
    item
    price
    item 1
    $1.00
    item 2
    $2.00
    item 3
    $3.00
    Table 2 is your lookup table.
    The formula in your entry table unit price is pasted into row 2 and copied down.
    IFERROR(OFFSET(Table 2::$A$1,MATCH(A2,item,0)−1,1,,),"")
    This says find the match of entry in A2 in item column in table 2 return the value in the column 1 over. If error return nothing ("").
    Will this work for you?
    Q

  • Problem with pop up menu created in fireworks

    I have created a banner with buttons and added a pop up menu to them.
    They work perfectly with-in Fireworks.
    I then export page to dreamweaver and both banner and buttons display properly but I cannot get pop up menu to show at all.
    I want to choose each menu and make the links with-in dreamweaver but cannot get pop up top show.
    I am using CS5 and would appreciate your help.
    AlSO I AM STILL LEARNING SO IF YOU COULD KEEP IT AS SIMPLE AS POSSIBLE I WOULD APPRECIATE IT. 

    HELLO AND THANK YOU FOR YOUR REPLY. I HAVE CREATED A QUICK BANNER WHICH IS SIMILAR TO THE ONE I WANT TO CREATE. THE LIST OF BUTTON ARE  PLACED INTO MY BANNER AND I HAVE ADDED POP UP MENUS TO ALL WITH 3 CELLS DEEP DROPPING DOWNWARDS. WHEN I VIEW THESE IN PREVIEW IN A WEB BROWSER FROM FIREWORKS THEY WORK PERFECTLY. THE PROBLEM IS THAT I DON'T SEEM TO BE ABLE TO MOVE THIS PAGE TO DREAM WEAVER AND HAVE IT DISPLAY THE POP UP MENUS. THEY WILL SHOW AS AN IMAGE AS IT IS SEEN HERE BUT WILL NOT DROP DOWN IN PREVIEW BROWSER IN DREAM WEAVER. I WANT TO BE ABLE TO SELECT THE INDIVIDUAL LISTS IN THE DROP DOWN MENU AND CREATE LINKS TO VARIOUS PAGES WITH-IN MY SITE IN DREAM WEAVER. IT MAY BE THE CASE THAT I AM NOT EXPORTING IT PROPERLY OR SAVING  IT CORRECTLY.

Maybe you are looking for

  • Video Card Question. Crossfire 7950s vs One GTX780

    Which is the better option for video editing on Adobe Premiere CC? I have the crossfire 7950's now but only one is installed since i would have to buy a new power supply. With the price drop on the NVIDIA GTX 780 I might pick up one of those and sell

  • Can't boot from USB or DVD. HP Pavilion g6-2257sr

    My new notebook HP Pavilion g6-2257sr don't let me to boot from USB device.  When notebook's booting, I pressed ESC and F10. Then I set up UFEI boot order - USB-device / DVD / OS selector.  I use official Windows 7 disk, and several own USB devices w

  • UWL action

    Hello, When I'm connected to SAP Portal I can see the UWL messages, like in the R/3 SBWP transaction. But I'm having a problem when I'm trying to "Approve" or "Refuse" an item. - If I do it in SBWP transaction, everything is ok: the system shows me t

  • MAC QUESTION--I'm looking for the toggle button for thumbnails

    MAC QUESTION--I'm looking for the toggle button that use to be on the bottom right of desktop folders to increase and decrease the size of the thumbnails.  Does this still exist?

  • My Left Command key shows the desktop and can't be used for other functions

    My Left Command key shows the desktop when pressed in. So if I try and copy (command + C) I end up staring at the desktop....This only happens with the left key. When checking System Preferences, none of the settings in keyboard preferences seems to