Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.MouseListener


  /*
   * Add mouse listener to the table closing it when the mouse is pressed.
   */
  protected 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


        _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
        _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

                }
            }
        });
       
        //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 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

            }
        });
       
        //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

        _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

    editor = new TableEditor(table);
    editor.horizontalAlignment = SWT.LEFT;
      editor.grabHorizontal = true;
      editor.minimumWidth = 50;
     
    table.addMouseListener(new MouseListener() {
     
      @Override
      public void mouseUp(MouseEvent arg0) {}
     
      @Override
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.