Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ToolItem.addSelectionListener()


        final ToolBar searchToolBar = new ToolBar( searchFieldInnerComposite, SWT.HORIZONTAL | SWT.FLAT );
        // Creating the Search In ToolItem
        final ToolItem searchInToolItem = new ToolItem( searchToolBar, SWT.DROP_DOWN );
        searchInToolItem.setText( Messages.getString( "SearchView.SearchIn" ) ); //$NON-NLS-1$
        // Adding the action to display the Menu when the item is clicked
        searchInToolItem.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent event )
            {
                Rectangle rect = searchInToolItem.getBounds();
                Point pt = new Point( rect.x, rect.y + rect.height );
View Full Code Here


        new ToolItem( searchToolBar, SWT.SEPARATOR );

        final ToolItem scopeToolItem = new ToolItem( searchToolBar, SWT.DROP_DOWN );
        scopeToolItem.setText( Messages.getString( "SearchView.Scope" ) ); //$NON-NLS-1$
        // Adding the action to display the Menu when the item is clicked
        scopeToolItem.addSelectionListener( new SelectionAdapter()
        {
            public void widgetSelected( SelectionEvent event )
            {
                Rectangle rect = scopeToolItem.getBounds();
                Point pt = new Point( rect.x, rect.y + rect.height );
View Full Code Here

      ToolItem algorithmButton = new ToolItem(toolBar, SWT.PUSH);
      algorithmButton.setText(algorithmName);

      new ToolItem(toolBar, SWT.SEPARATOR);

      algorithmButton.addSelectionListener(new SelectionListener() {
        public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
          currentLayoutAlgorithm = algorithm;
          algorithm.setEntityAspectRatio((double) mainComposite.getClientArea().width / (double) mainComposite.getClientArea().height);
          animate = algorithmAnimate;
          performLayout(false);
View Full Code Here

      });
    }

    ToolItem redrawButton = new ToolItem(toolBar, SWT.PUSH);
    redrawButton.setText("Redraw");
    redrawButton.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        mainComposite.redraw();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

      }
    });

    ToolItem stopButton = new ToolItem(toolBar, SWT.PUSH);
    stopButton.setText("Stop");
    stopButton.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        currentLayoutAlgorithm.stop();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

      }
    });

    ToolItem continuousButton = new ToolItem(toolBar, SWT.CHECK);
    continuousButton.setText("Continuous");
    continuousButton.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        setContinuous();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

      }
    });

    ToolItem asynchronousButton = new ToolItem(toolBar, SWT.CHECK);
    asynchronousButton.setText("Asynchronous");
    asynchronousButton.addSelectionListener(new SelectionListener() {
      public void widgetSelected(SelectionEvent e) {
        setAsynchronously();
      }

      public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

     * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.ToolBar, int)
     */
    public void fill( final ToolBar parent, int index ) {
        ToolItem item = new ToolItem(parent, SWT.DROP_DOWN, index);
        item.setImage(UiPlugin.getDefault().getImage(ImageConstants.NEW_WIZ));
        item.addSelectionListener(new SelectionListener(){

            protected ImageRegistry registry;
            public void widgetSelected( SelectionEvent e ) {
                widgetDefaultSelected(e);
            }
View Full Code Here

    toolItem.setText("Custom Swing Component");
    toolItem.setToolTipText("Choose custom component");
    String iconUrl = "icons/beans.png";
    Image img = VisualSwingPlugin.getSharedImage(VisualSwingPlugin.PLUGIN_ID, iconUrl);
    toolItem.setImage(img);
    toolItem.addSelectionListener(this);
    new ToolItem(toolBar, SWT.SEPARATOR);

    updateScrolledComposite();
  }
View Full Code Here

        toolItem.setText(" " + widgetName);
        toolItem.setToolTipText(widgetClassname);
        String iconUrl = config.getAttribute("icon");
        Image img = VisualSwingPlugin.getSharedImage(pluginId, iconUrl);
        toolItem.setImage(img);
        toolItem.addSelectionListener(this);
        toolItem.setData(widgetClassname);
      }
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.