Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Sash


    mform.addPart(detailsPart);
    registerPages(detailsPart);
  }
 
  private void onSashPaint(Event e) {
    Sash sash = (Sash)e.widget;
    IManagedForm form = (IManagedForm)sash.getParent().getData("form"); //$NON-NLS-1$
    FormColors colors = form.getToolkit().getColors();
    boolean vertical = (sash.getStyle() & SWT.VERTICAL)!=0;
    GC gc = e.gc;
    Boolean hover = (Boolean)sash.getData("hover"); //$NON-NLS-1$
    gc.setBackground(colors.getColor(IFormColors.TB_BG));
    gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
    Point size = sash.getSize();
    if (vertical) {
      if (hover!=null)
        gc.fillRectangle(0, 0, size.x, size.y);
      //else
        //gc.drawLine(1, 0, 1, size.y-1);
View Full Code Here


    private void hookSashListeners() {
      purgeSashes();
      Control [] children = getChildren();
      for (int i=0; i<children.length; i++) {
        if (children[i] instanceof Sash) {
          Sash sash = (Sash)children[i];
          if (sashes.contains(sash))
            continue;
          sash.addListener(SWT.Paint, listener);
          sash.addListener(SWT.MouseEnter, listener);
          sash.addListener(SWT.MouseExit, listener);
          sashes.add(sash);
        }
      }
    }
View Full Code Here

        }
      }
    }
    private void purgeSashes() {
      for (Iterator iter=sashes.iterator(); iter.hasNext();) {
        Sash sash = (Sash)iter.next();
        if (sash.isDisposed())
          iter.remove();
      }
    }
View Full Code Here

        scrollPalette((ScrollBar) event.widget);
      }
    });

    // Sash to see more of image or image data.
    sash = new Sash(shell, SWT.HORIZONTAL);
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    gridData.horizontalAlignment = GridData.FILL;
    sash.setLayoutData(gridData);
    sash.addSelectionListener(new SelectionAdapter() {
View Full Code Here

  void createControls(final Composite parent) {
    tabs = createTabs();
    createToolBar(parent);
    createTabList(parent);
    hSash = new Sash(parent, SWT.HORIZONTAL);
    createTabDesc(parent);
    vSash = new Sash(parent, SWT.VERTICAL);
    createCanvas(parent);
    createControlPanel(parent);

    FormData data;
    FormLayout layout = new FormLayout();
View Full Code Here

    /* Create the sashes */
    int style = getDefaultStyle();
    if (smoothButton.getSelection())
      style |= SWT.SMOOTH;
    vSash = new Sash(sashComp, SWT.VERTICAL | style);
    hSash = new Sash(sashComp, SWT.HORIZONTAL | style);

    /* Add the listeners */
    hSash.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        Rectangle rect = vSash.getParent().getClientArea();
View Full Code Here

    mform.addPart(detailsPart);
    registerPages(detailsPart);
  }
 
  private void onSashPaint(Event e) {
    Sash sash = (Sash)e.widget;
    IManagedForm form = (IManagedForm)sash.getParent().getData("form"); //$NON-NLS-1$
    FormColors colors = form.getToolkit().getColors();
    boolean vertical = (sash.getStyle() & SWT.VERTICAL)!=0;
    GC gc = e.gc;
    Boolean hover = (Boolean)sash.getData("hover"); //$NON-NLS-1$
    gc.setBackground(colors.getColor(IFormColors.TB_BG));
    gc.setForeground(colors.getColor(IFormColors.TB_BORDER));
    Point size = sash.getSize();
    if (vertical) {
      if (hover!=null)
        gc.fillRectangle(0, 0, size.x, size.y);
      //else
        //gc.drawLine(1, 0, 1, size.y-1);
View Full Code Here

    private void hookSashListeners() {
      purgeSashes();
      Control [] children = getChildren();
      for (int i=0; i<children.length; i++) {
        if (children[i] instanceof Sash) {
          Sash sash = (Sash)children[i];
          if (sashes.contains(sash))
            continue;
          sash.addListener(SWT.Paint, listener);
          sash.addListener(SWT.MouseEnter, listener);
          sash.addListener(SWT.MouseExit, listener);
          sashes.add(sash);
        }
      }
    }
View Full Code Here

        }
      }
    }
    private void purgeSashes() {
      for (Iterator iter=sashes.iterator(); iter.hasNext();) {
        Sash sash = (Sash)iter.next();
        if (sash.isDisposed())
          iter.remove();
      }
    }
View Full Code Here

            final Composite mainPropertyEditorOuterComposite = new Composite( composite, SWT.NONE );
            mainPropertyEditorOuterComposite.setLayout( glayout( 1, 0, 4, 0, 0 ) );

            final Composite mainPropertyEditorComposite = new Composite( mainPropertyEditorOuterComposite, SWT.NONE );
           
            final Sash sash = new Sash( composite, SWT.VERTICAL );
            sash.setLayoutData( gdhhint( gdvfill(), 1 ) );
           
            final Composite relatedContentComposite = new Composite( composite, SWT.NONE );
            relatedContentComposite.setLayout( glayout( 2, 0, 0 ) );
           
            relatedContentComposite.setData( RELATED_CONTENT_WIDTH, ( (double) part.getRelatedContentWidth() ) / ( (double) 100 ) );
           
            composite.addListener
            (
                SWT.Resize,
                new org.eclipse.swt.widgets.Listener()
                {
                    public void handleEvent( final Event event )
                    {
                        refreshSashFormLayout( composite, mainPropertyEditorComposite, relatedContentComposite, sash );
                    }
                }
            );
           
            sash.addListener
            (
                SWT.Selection,
                new org.eclipse.swt.widgets.Listener()
                {
                    public void handleEvent( final Event event )
                    {
                        final int width = composite.getClientArea().width - sash.getBounds().width;
                        double ratio = ( (double) ( width - event.x ) ) / ( (double) width );
                       
                        if( ratio < 0.2d )
                        {
                            ratio = 0.2d;
View Full Code Here

TOP

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

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.