Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.MouseListener


                }
            }
        });

        //listener for double clicking to open the selection mbean
        _queueTable.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean(_queueTable);
            }
           
            public void mouseDown(MouseEvent e){}
            public void mouseUp(MouseEvent e){}
        });
       
        Group exchangesGroup = new Group(_paramsComposite, SWT.SHADOW_NONE);
        exchangesGroup.setBackground(_paramsComposite.getBackground());
        exchangesGroup.setText("Exchanges");
        exchangesGroup.setLayout(new GridLayout(2,false));
        gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        exchangesGroup.setLayoutData(gridData);
              
        _exchangeTable = new Table (exchangesGroup, SWT.MULTI | SWT.SCROLL_LINE | SWT.BORDER | SWT.FULL_SELECTION);
        _exchangeTable.setLinesVisible (true);
        _exchangeTable.setHeaderVisible (true);
        data = new GridData(SWT.FILL, SWT.FILL, true, true);
        _exchangeTable.setLayoutData(data);
       
        _exchangeTableViewer = new TableViewer(_exchangeTable);
        final TableSorter exchangeTableSorter = new TableSorter();
       
        for (int i = 0; i < titles.length; i++)
        {
            final int index = i;
            final TableColumn column = new TableColumn (_exchangeTable, SWT.NONE);

            column.setText(titles[i]);
            column.setWidth(bounds[i]);
            column.setResizable(true);

            //Setting the right sorter
            column.addSelectionListener(new SelectionAdapter()
            {
                @Override
                public void widgetSelected(SelectionEvent e)
                {
                    exchangeTableSorter.setColumn(index);
                    final TableViewer viewer = _exchangeTableViewer;
                    int dir = viewer .getTable().getSortDirection();
                    if (viewer.getTable().getSortColumn() == column)
                    {
                        dir = dir == SWT.UP ? SWT.DOWN : SWT.UP;
                    }
                    else
                    {
                        dir = SWT.UP;
                    }
                    viewer.getTable().setSortDirection(dir);
                    viewer.getTable().setSortColumn(column);
                    viewer.refresh();
                }
            });

        }
       
        _exchangeTableViewer.setContentProvider(new ContentProviderImpl());
        _exchangeTableViewer.setLabelProvider(new LabelProviderImpl());
        _exchangeTableViewer.setSorter(exchangeTableSorter);
        _exchangeTable.setSortColumn(_exchangeTable.getColumn(0));
        _exchangeTable.setSortDirection(SWT.UP);
       
        Composite exchangesRightComposite = _toolkit.createComposite(exchangesGroup);
        gridData = new GridData(SWT.FILL, SWT.FILL, false, true);
        exchangesRightComposite.setLayoutData(gridData);
        exchangesRightComposite.setLayout(new GridLayout());
       
        final Button createExchangeButton = _toolkit.createButton(exchangesRightComposite, "Create ...", SWT.PUSH);
        createExchangeButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
        createExchangeButton.addSelectionListener(new SelectionAdapter()
        {
            public void widgetSelected(SelectionEvent e)
            {
                createExchange(createQueueButton.getShell());
            }
        });
       
        final Button deleteExchangeButton = _toolkit.createButton(exchangesRightComposite, "Delete", SWT.PUSH);
        deleteExchangeButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        deleteExchangeButton.setEnabled(false);
        deleteExchangeButton.addSelectionListener(new SelectionAdapter()
        {
            public void widgetSelected(SelectionEvent e)
            {
                deleteQueuesOrExchanges(deleteExchangeButton.getShell(), VhostOperations.DELETE_EXCHANGE);
            }
        });
 
        _exchangeTableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
            public void selectionChanged(SelectionChangedEvent evt)
            {
                int selectionIndex = _exchangeTable.getSelectionIndex();

                if (selectionIndex != -1)
                {
                    deleteExchangeButton.setEnabled(true);
                }
                else
                {
                    deleteExchangeButton.setEnabled(false);
                }
            }
        });
       
        //listener for double clicking to open the selection mbean
        _exchangeTable.addMouseListener(new MouseListener()                                             
        {
            // MouseListener implementation
            public void mouseDoubleClick(MouseEvent event)
            {
                openMBean(_exchangeTable);
View Full Code Here


          if (!controlFocusTransfer)
            handleFocusChange();
        }
      }
    });
    addMouseListener(new MouseListener() {
      public void mouseDoubleClick(MouseEvent e) {
      }

      public void mouseDown(MouseEvent e) {
        // select a link
View Full Code Here

   *
   * @return the mouse listener
   */
  protected final MouseListener getRulerMouseListener() {
    if (fMouseListener == null) {
      fMouseListener= new MouseListener() {

        private boolean fDoubleClicked= false;
        private final int fDoubleClickTime= getSite().getShell().getDisplay().getDoubleClickTime();
        private long fMouseUpDelta= 0;

View Full Code Here

 
   
  public InstancesTree(Composite parent) {
    tree = new Tree(parent, SWT.BORDER | SWT.SINGLE);
    this.display = MainWindow.display;
    tree.addMouseListener(new MouseListener() {
     
      @Override
      public void mouseUp(MouseEvent e) {}
     
      @Override
View Full Code Here

                  else {
                      textLabel.setText( StringUtils.parseName( from ) + ":\n" + text );
                }
              }
            }
      textLabel.addMouseListener( new MouseListener() {
        public void mouseDoubleClick( MouseEvent e ) {}
        public void mouseUp( MouseEvent e ) {}
        public void mouseDown( MouseEvent e ) {
          if ( type != null )
            parent.getJChat().focusTab( from, type );
View Full Code Here

    txtKarafDir.setLayoutData(txtKarafDirGridData);

    btnBrowseButton = new Button(this, SWT.PUSH);
    btnBrowseButton
        .setText(Messages.AbstractKarafRuntimeComposite_browse_text);
    btnBrowseButton.addMouseListener(new MouseListener() {

      public void mouseDoubleClick(MouseEvent e) {
      }

      public void mouseDown(MouseEvent e) {

      }

      public void mouseUp(MouseEvent e) {
        DirectoryDialog dd = new DirectoryDialog(Display.getDefault()
            .getActiveShell(), SWT.OPEN);
        dd.setFilterPath(txtKarafDir.getText());
        String dir = dd.open();
        if (dir != null) {
          txtKarafDir.setText(dd.getFilterPath());
        }
      }

    });

    installLabel = new Label(this, SWT.NONE);
    installLabel
        .setText(Messages.AbstractKarafRuntimeComposite_runtimeinstall_label);
    GridData installLabelGridData = new GridData();
    installLabelGridData.grabExcessHorizontalSpace = true;
    installLabelGridData.horizontalAlignment = SWT.FILL;
    installLabelGridData.horizontalSpan = 2;
    installLabel.setLayoutData(installLabelGridData);

    btnDownloadAndInstallButton = new Button(this, SWT.PUSH);
    btnDownloadAndInstallButton
        .setText(Messages.AbstractKarafRuntimeComposite_downloadAndInstall_text);
    btnDownloadAndInstallButton
        .setToolTipText(Messages.AbstractKarafRuntimeComposite_downloadAndInstall_description);
    btnDownloadAndInstallButton.addMouseListener(new MouseListener() {

      public void mouseDoubleClick(MouseEvent e) {
      }

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

        }
        example.redraw();
      }
    };

    mouseListener = new MouseListener() {

      public void mouseDoubleClick(MouseEvent e) {
      }

      /**
 
View Full Code Here

        }
        example.redraw();
      }
    };

    mouseListener = new MouseListener() {

      public void mouseDoubleClick(MouseEvent e) {
      }

      /**
 
View Full Code Here

                    renameSelection();
                }
            }
        });

        treeWithInterpreters.addMouseListener(new MouseListener() {

            public void mouseUp(MouseEvent e) {
            }

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

            //https://sourceforge.net/tracker2/?func=detail&aid=2057092&group_id=85796&atid=577329
            TreeViewer treeViewer = getTreeViewer();
            treeViewer.removeSelectionChangedListener(this);
            Tree tree = treeViewer.getTree();

            tree.addMouseListener(new MouseListener() {

                public void mouseDoubleClick(MouseEvent e) {
                    tryToMakeSelection();
                }
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.