SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Eclipse Plug-in mouse issues

    I am new to Eclipse and Eclipse Plug-ins so please go easy on me. I am creating a new plug-in and when I open it, I am discovering 2 issues.

    1) I change the mouse icon and the mouse does not change, even when I hover over my new plug-in.

    2) Clicking works, right left and middle, but the middle scroll doesn't work.

    It seems as if Eclipse its self it taking the mouse over and scroll commands and not my plug-in. How can I tell Eclipse to forward the messages to my plug-in? Or if that is not the correct thing to do, what do I need to do?

    Thanks for any help!

  2. #2
    Non-Member
    Join Date
    Jun 2008
    Location
    China
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am also a eclipse plug-in developer. Looking forward to help you. Could you attach your code please?

  3. #3
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    I appreciate your help. Suffice it to say I cannot post the entire code directly as the code is sensitive, but its something like this:

    The mouse change event, basically, when a check box is clicked, I want to load something that takes time, and I know I can use the Progress interface from the eclipse plug-in but I still want to figure this out.

    Code:
    public void actionPerformed(ActionEvent e) {
    
    			setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    			
    			// Load my process
    			setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    		}

    Test code:

    Code:
    public class TestDriver {
    
    	static PanelObject obj;
    
    	public static void main(String[] args) {
    
    		SwingUtilities.invokeLater(new Runnable() {
    			public void run() {
    				final JFrame jFrame = new JFrame();
    
    				jFrame.setSize(800, 800);
    				jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    				
    				obj = new PanelObject();
    
    				jFrame.getContentPane().add(obj, BorderLayout.CENTER);
    				jFrame.setVisible(true);
    				jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                    }
            }
    }
    This test code works as expected ...

    This code does not ...

    Code:
    public class LuciadMapView extends ViewPart implements ViewerEventListener,
    
    	@Override
    	public void createPartControl(Composite parent) {
    		Composite base = new Composite(parent, SWT.EMBEDDED | SWT.CENTER);
    		base.setLayout(new FillLayout());
    
    		composite = new Composite(base, SWT.EMBEDDED | SWT.CENTER);
    		composite.setLayout(new FillLayout());
    
    		frame = SWT_AWT.new_Frame(composite);
    
    		frame.setSize(800, 800);
    
    		SwingUtilities.invokeLater(new Runnable() {
    
    			public void run() {
    				obj = new PanelObject ();
    				frame.add(obj);
    				frame.setVisible(true);
    				}
    			}
    		});
    	}
    I appreciate your help! If there is more of my code you would like to see, please tell me, and I will provide.

    Thanks!

  4. #4
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically my question is this:

    MouseWheelEvents are not getting to my JFrame when I embed the frame into a ViewPart. Is there a way to forward these events?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •