Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.MouseListener


            tableItem.setData(item);
        }
    }

    private void addMouseListener(final Table table, final Shell dialog) {
        table.addMouseListener(new MouseListener() {
            public void mouseDoubleClick(MouseEvent e) {
                ok(dialog, table);
            }

            public void mouseDown(MouseEvent e) {
View Full Code Here


            tableItem.setData(item);
        }
    }

    private void addMouseListener(final Table table, final Shell dialog) {
        table.addMouseListener(new MouseListener() {
            public void mouseDoubleClick(MouseEvent e) {
                ok(dialog, table);
            }

            public void mouseDown(MouseEvent e) {
View Full Code Here

    gd.widthHint = 250;
    valueText.setLayoutData(gd);
    if (null != contextValue && null != contextValue.objClass) valueText.setText(contextValue.objClass.getName());
        Button browse = new Button(composite, 8);
        browse.setText(Messages.ContextValueDialog_BUTTON_BROWSE);
        browse.addMouseListener(new MouseListener() {
            @Override
      public void mouseDown(MouseEvent e)
            {
                try {
                    IJavaProject javaProject = JavaCore.create(resource.getProject());
                    if(javaProject != null)
                    {
                        org.eclipse.jdt.core.search.IJavaSearchScope searchScope = SearchEngine.createJavaSearchScope(new IJavaElement[]{javaProject});
                        SelectionDialog sd = JavaUI.createTypeDialog(getShell(), new ApplicationWindow(getShell()), searchScope, 2, false);
                        sd.open();
                        Object objects[] = sd.getResult();
                        if(objects != null && objects.length > 0)
                        {
                            IType type = (IType)objects[0];
                            String fullyQualifiedName = type.getFullyQualifiedName('.');
                            valueText.setText(type.getFullyQualifiedName());
                            String[] interfaces = type.getSuperInterfaceNames();
                            boolean isList = false;
                            if ("java.lang.Object".equals(fullyQualifiedName)) isList = true; //$NON-NLS-1$
                            else {
                              for (int i=0; i<interfaces.length; i++) {
                                  if (interfaces[i].equals("java.util.Collection") || interfaces[i].equals("java.util.List") || interfaces[i].equals("java.util.Set")) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                                      isList = true;
                                      break;
                                  }
                              }
                            }
                            if (isList) {
                                singleBrowse.setEnabled(true);
                                singleLabel.setEnabled(true);
                                singleValueText.setEnabled(true);
                            }
                            else {
                                singleBrowse.setEnabled(false);
                                singleLabel.setEnabled(false);
                                singleValueText.setEnabled(false);
                                singleValueText.setText(""); //$NON-NLS-1$
                            }
                        }
                    }
                    else {
                        MessageDialog.openError(getShell(), Messages.ContextValueDialog_JAVA_PROJECT_ERROR, Messages.ContextValueDialog_MUST_BE_JAVA_PROJECT);
                    }
                }
                catch(JavaModelException _ex) { }
            }

            @Override
      public void mouseDoubleClick(MouseEvent mouseevent)
            {
            }

            @Override
      public void mouseUp(MouseEvent mouseevent)
            {
            }

        });

        boolean enabled = false;
        if (null != contextValue && null != contextValue.singularClass) enabled = true;
    singleLabel = new Label(composite, SWT.NULL);
    singleLabel.setEnabled(enabled);
    singleLabel.setText(Messages.ContextValueDialog_LABEL_LIST_ENTRY_TYPE);
    singleValueText = new Text(composite, SWT.BORDER);
    singleValueText.setEnabled(enabled);
    singleValueText.setBackground(new Color(null, 255, 255, 255));
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.widthHint = 250;
    singleValueText.setLayoutData(gd);
    if (enabled) singleValueText.setText(contextValue.singularClass.getName());
        singleBrowse = new Button(composite, 8);
        singleBrowse.setEnabled(enabled);
        singleBrowse.setText(Messages.ContextValueDialog_BUTTON_BROWSE);
        singleBrowse.addMouseListener(new MouseListener() {
            @Override
      public void mouseDown(MouseEvent e)
            {
                try {
                    IJavaProject javaProject = JavaCore.create(resource.getProject());
View Full Code Here

        _tableViewer.setContentProvider(new LoggingTableContentProvider());
        _tableViewer.setLabelProvider(new LoggingTableLabelProvider());
        _tableViewer.setSorter(tableSorter);
        _table.setSortColumn(_table.getColumn(0));
        _table.setSortDirection(SWT.UP);
        _table.addMouseListener(new MouseListener()
        {
            public void mouseDoubleClick(MouseEvent event)
            {
                editLoggerLevel(_table.getShell());
            }
View Full Code Here

        _queuesTable.setSortColumn(_queuesTable.getColumn(0));
        _queuesTable.setSortDirection(SWT.UP);
        _queuesTableViewer.setInput(new String[]{"Select a binding key to view queues"});
       
        //listener for double clicking to open the selection mbean
        _queuesTable.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean(_queuesTable);
View Full Code Here

        redeliveredText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        redeliveredText.setText("-");
        redeliveredText.setEditable(false);
       
        //listener for double clicking to view message content
        _table.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                viewMessageContent();
View Full Code Here

            }
        });
       
        //listener for double clicking to open the selection mbean
        _table.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean(_table);
View Full Code Here

                    _openButton.setEnabled(true);
                }
            }
        });
       
        _table.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean();
View Full Code Here

                }
            }
        });
       
        //listener for double clicking to open the selection mbean
        _bindingNumberTable.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean(_bindingNumberTable);
View Full Code Here

        _tableViewer.setContentProvider(new LoggingTableContentProvider());
        _tableViewer.setLabelProvider(new RuntimeLoggingTableLabelProvider());
        _tableViewer.setSorter(tableSorter);
        _table.setSortColumn(_table.getColumn(0));
        _table.setSortDirection(SWT.UP);
        _table.addMouseListener(new MouseListener()
        {
            public void mouseDoubleClick(MouseEvent event)
            {
                editLoggerLevel(_table.getShell());
            }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.MouseListener

Copyright © 2018 www.massapicom. 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.