Examples of Sash


Examples of org.eclipse.swt.widgets.Sash

            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

Examples of org.eclipse.swt.widgets.Sash

   */
  public void layoutVertical()
  {
    Control[] c = getChildren();
    if ( c.length > 1 ) {
      final Sash sash = new Sash( this, SWT.VERTICAL );
      final int width = getBounds().width;
      FormData data = new FormData();
      data.top = new FormAttachment( 0, 0 ); // Attach to top
      data.bottom = new FormAttachment( 100, 0 ); // Attach to bottom
      data.left = new FormAttachment( location * 100 / width, 0 ); // Attach
                                                                    // halfway
                                                                    // across
      data.width = size;
      sash.setLayoutData( data );
      sash.addSelectionListener( new SelectionAdapter()
      {
        public void widgetSelected( SelectionEvent event )
        {
          // We reattach to the left edge, and we use the x value of the event
          // to determine the offset from the left
          ( (FormData)sash.getLayoutData() ).left = new FormAttachment( event.x * 100 / width, 0 );
          // Until the parent window does a layout, the sash will not be redrawn
          // in its new location.
          superLayout();
        }
      } );
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

   */
  public void layoutHorizontal()
  {
    Control[] c = getChildren();
    if ( c.length > 1 ) {
      final Sash sash = new Sash( this, SWT.HORIZONTAL );
      final int height = getBounds().height;
      FormData data = new FormData();
      data.left = new FormAttachment( 0, 0 ); // Attach halfway across
      data.right = new FormAttachment( 100, 0 ); // Attach to bottom
      data.top = new FormAttachment( location * 100 / height, 0 ); // Attach to
                                                                    // top
      data.width = size;
      sash.setLayoutData( data );
      sash.addSelectionListener( new SelectionAdapter()
      {
        public void widgetSelected( SelectionEvent event )
        {
          // We reattach to the left edge, and we use the x value of the event
          // to determine the offset from the left
          ( (FormData)sash.getLayoutData() ).top = new FormAttachment( event.y * 100 / height, 0 );
          // Until the parent window does a layout, the sash will not be redrawn
          // in its new location.
          superLayout();
        }
      } );
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

   * @return Sash
   *
   * @since 3.1
   */
  protected Sash createSash(final Composite composite, final Control rightControl) {
    final Sash sash = new Sash(composite, SWT.VERTICAL);
    sash.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    sash.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    // the following listener resizes the tree control based on sash deltas.
    // If necessary, it will also grow/shrink the dialog.
    sash.addListener(SWT.Selection, new Listener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
       */
      public void handleEvent(Event event) {
        if (event.detail == SWT.DRAG) {
          return;
        }
        int shift = event.x - sash.getBounds().x;
        GridData data = (GridData) rightControl.getLayoutData();
        int newWidthHint = data.widthHint + shift;
        if (newWidthHint < 20) {
          return;
        }
View Full Code Here

Examples of org.eclipse.swt.widgets.Sash

      throw new UnsupportedOperationException("Trays not supported with custom layouts"); //$NON-NLS-1$
    }
    final Shell shell = getShell();
    leftSeparator = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);
    leftSeparator.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    sash = new Sash(shell, SWT.VERTICAL);
    sash.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    rightSeparator = new Label(shell, SWT.SEPARATOR | SWT.VERTICAL);
    rightSeparator.setLayoutData(new GridData(GridData.FILL_VERTICAL));
    trayControl = tray.createContents(shell);
    Rectangle clientArea = shell.getClientArea();
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.