Examples of Sash


Examples of org.eclipse.swt.widgets.Sash

        }
      }
      annotationsTable.setSorter(new ViewerSorter());
      annotationsTable.setInput(matchingAnnotations);

      final Sash sash = new Sash(annotationsComposite, SWT.HORIZONTAL);

      final PropertySheetPage propertySheet = new PropertySheetPage();
      propertySheet.createControl(annotationsComposite);
      propertySheet.setPropertySourceProvider(new IPropertySourceProvider() {
        public IPropertySource getPropertySource(Object object) {
          if (object instanceof Annotation) {
            IPropertySource annotationPropertySource = new AnnotationPropertySource(((Annotation) object));
            return annotationPropertySource;
          }
          return null;
        }
      });

      annotationsTable.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
          propertySheet.selectionChanged(null, event.getSelection());
        }
      });

      final FormLayout form = new FormLayout();
      annotationsComposite.setLayout(form);

      FormData tableData = new FormData();
      tableData.top = new FormAttachment(0, 0);
      tableData.bottom = new FormAttachment(sash, 2);
      tableData.left = new FormAttachment(0, 0);
      tableData.right = new FormAttachment(100, 0);
      annotationsTable.getControl().setLayoutData(tableData);

      FormData propertiesData = new FormData();
      propertiesData.top = new FormAttachment(sash, 2);
      propertiesData.left = new FormAttachment(0, 0);
      propertiesData.right = new FormAttachment(100, 0);
      propertiesData.bottom = new FormAttachment(100, 0);
      propertySheet.getControl().setLayoutData(propertiesData);

      final FormData sashData = new FormData();
      sashData.top = new FormAttachment(60, 0);
      sashData.left = new FormAttachment(0, 0);
      sashData.right = new FormAttachment(100, 0);
      sash.setLayoutData(sashData);
      sash.addListener(SWT.Selection, new org.eclipse.swt.widgets.Listener() {
        public void handleEvent(Event e) {
          sashData.top = new FormAttachment(0, e.y);
          annotationsComposite.layout();
        }
      });
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

   */
  public void init(Control first, Control second,
      int sasherStyle, int percent) {
    this.sashStyle = sasherStyle;

    sash = new Sash(this, sashStyle);

    // create position instructions
    FormData firstData = new FormData();
    final FormData sashData = new FormData();
    FormData secondData = new FormData();
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

  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

Examples of org.eclipse.swt.widgets.Sash

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

Examples of org.eclipse.swt.widgets.Sash

        iter.remove();
    }
  }

   private void onSashPaint(Event e) {
        Sash sash = (Sash)e.widget;
        FormColors colors = managedForm.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

Examples of org.eclipse.swt.widgets.Sash

    sashFormData = new FormData();
    sashFormData.width = 1;
    sashFormData.top = new FormAttachment(0, 0);
    sashFormData.left = new FormAttachment(0, 200);
    sashFormData.bottom = new FormAttachment(100, 0);
    final Sash sash = new Sash(form.getBody(), SWT.VERTICAL);
    sash.setBackground(toolkit.getColors().getBorderColor());
    sash.setLayoutData(sashFormData);
    sash.addListener(SWT.Selection, new Listener() {
      @Override
      public void handleEvent(Event e) {
        ((FormData) sash.getLayoutData()).left = new FormAttachment(0, e.x);
        sash.getParent().layout();
      }
    });

    // Extension list:
    FormData leftData = new FormData();
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

    int sashStyle =
      (orientation == SWT.HORIZONTAL) ? SWT.VERTICAL : SWT.HORIZONTAL;

    Control c;
    /*if(liveUpdate) c = new SashCanvas(this, sashStyle);
    else*/ c = new Sash(this, sashStyle);
    final Control sash = c;

    sash.setBackground(background);
    sash.setForeground(foreground);
    sash.addListener(SWT.Selection, sashListener);
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

      parent.setBackground(color);
     
        _mainComposite = new Composite(parent, SWT.NONE);
        _mainComposite.setBackground(color);
        _leftComposite = new Composite(_mainComposite, SWT.NONE);
        _sash = new Sash(_mainComposite, SWT.VERTICAL);
        _rightComposite = new Composite(_mainComposite, SWT.NONE);

        color = new Color(Display.getCurrent(), 0, 120, 100);
        _rightComposite.setBackground(color);
       
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

    this.leftControl = leftControl;
    this.rightControl = rightControl;
    this.parent = parent;
    this.fixLeftWidth = fixLeftControl;

    sash = new Sash(parent, SWT.VERTICAL);
    parent.setLayout(new FormLayout());

    fdLeft = new FormData();
    fdLeft.left = new FormAttachment(0, 0);
    fdLeft.right = new FormAttachment(sash, 0);
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

     * Left,Rigth,Top and Botton sashes. The elements
     * may be null depending whether there is a shash
     * beside the <code>part</code>
     */
    void findSashes(LayoutTree child, PartPane.Sashes sashes) {
        Sash sash = (Sash) getSash().getControl();
        boolean leftOrTop = children[0] == child;
        if (sash != null) {
            LayoutPartSash partSash = getSash();
            //If the child is in the left, the sash
            //is in the rigth and so on.
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.