Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.ToolBar


            job.schedule();
        }
    }

    void createToolBar(Section section) {
        ToolBar toolbar = new ToolBar(section, SWT.FLAT);
        section.setTextClient(toolbar);

        ToolItem addItem = new ToolItem(toolbar, SWT.PUSH);
        addItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
        addItem.setToolTipText("Add Plugin");
View Full Code Here


    private void createSection(Section section, FormToolkit toolkit) {
        section.setText("Classpath");
        section.setDescription("Define paths for classes that may appear in the bundle. If empty, the Eclipse project classpath will be used.");

        // Section toolbar buttons
        ToolBar toolbar = new ToolBar(section, SWT.FLAT);
        section.setTextClient(toolbar);
        final ToolItem addJarItem = new ToolItem(toolbar, SWT.PUSH);
        addJarItem.setImage(imgAddJar);
        addJarItem.setToolTipText("Add JAR");
View Full Code Here

    void createSection(Section section, FormToolkit toolkit) {
        section.setText("Private Packages");
        section.setDescription("The listed packages will be included in the bundle but not exported.");

        ToolBar toolbar = new ToolBar(section, SWT.FLAT);
        section.setTextClient(toolbar);
        final ToolItem addItem = new ToolItem(toolbar, SWT.PUSH);
        addItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
        addItem.setToolTipText("Add");
View Full Code Here

        flatViewImg.dispose();
    }

    @SuppressWarnings("unused")
    private void createUnresolvedViewToolBar(final Composite parent) {
        ToolBar unresolvedToolBar = new ToolBar(parent, SWT.FLAT | SWT.HORIZONTAL);
        GridData gd_unresolvedToolBar = new GridData(SWT.RIGHT, SWT.FILL, true, false);
        unresolvedToolBar.setLayoutData(gd_unresolvedToolBar);

        final ToolItem treeViewToggle = new ToolItem(unresolvedToolBar, SWT.RADIO);
        treeViewToggle.setImage(treeViewImg);
        treeViewToggle.setToolTipText("Tree View");
        treeViewToggle.setSelection(failureTreeMode);
View Full Code Here

    /**
     * Tells the DropDownAction that it should listen to mouse events on a given
     * ToolBarManager. Used to display the Menu when the mouse is clicked.
     */
    public IAction listenToMouseOn(IToolBarManager tbm) {
        final ToolBar tb = ((ToolBarManager)tbm).getControl();
        tb.addMouseListener(new MouseAdapter() {
            public void mouseDown(MouseEvent e) {
                ToolItem ti = tb.getItem(new Point(e.x, e.y));
                if (!(ti.getData() instanceof ActionContributionItem)) return;

                ActionContributionItem actionContributionItem = (ActionContributionItem) ti.getData();
                IAction action = actionContributionItem.getAction();
                if (action != DropDownAction.this) return;
View Full Code Here

    assertNull( backButton.getImage() );
  }

  @Test
  public void testCreatePageSwitcher() {
    ToolBar pageSwitcher = webUI.getPageSwitcher();

    assertNotNull( pageSwitcher );
    assertEquals( 1, pageSwitcher.getItemCount() );
    assertTrue( pageSwitcher.getItem( 0 ).isListening( SWT.Selection ) );
  }
View Full Code Here

    assertEquals( image, button.getImage() );
  }

  @Test
  public void testAppliesImageOnItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem toolItem = new ToolItem( toolBar, SWT.NONE );
    Image image = environment.getTestImage();
    Rule rule = PassePartout.when( new AlwaysTrueContidtion() ).then( new ImageInstruction( image ) );
    ResourceImpl resource = new ResourceImpl( rule );
    shell.open();
View Full Code Here

    assertTrue( hasListener );
  }

  @Test
  public void testRegistersItselfAsResizeListenerWithItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem toolItem = new ToolItem( toolBar, SWT.NONE );
    Color color = shell.getDisplay().getSystemColor( SWT.COLOR_BLUE );
    Rule rule = PassePartout.when( new AlwaysTrueContidtion() ).then( new ForegroundInstruction( color ) );
    ResourceImpl resource = new ResourceImpl( rule );
View Full Code Here

    assertEquals( BoundsUtil.getBounds( shell.getBounds() ), referenceBounds );
  }

  @Test
  public void testUsesDisplayAsReferenceForItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem item = new ToolItem( toolBar, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( item );

    Bounds referenceBounds = environment.getReferenceBounds();
View Full Code Here

    assertEquals( BoundsUtil.getBounds( shell.getBounds() ), parentBounds );
  }

  @Test
  public void testUsesShellAsReferenceForItem() {
    ToolBar toolBar = new ToolBar( shell, SWT.NONE );
    ToolItem item = new ToolItem( toolBar, SWT.NONE );
    UIEnvironment environment = UIEnvironmentFactory.createEnvironment( item );

    Bounds parentBounds = environment.getParentBounds();
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.ToolBar

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.