Java Code Examples for org.eclipse.swt.custom.SashForm#setWeights()

The following examples show how to use org.eclipse.swt.custom.SashForm#setWeights() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenameTypeWizardSimilarElementsPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createTreeAndSourceViewer(Composite superComposite) {
	SashForm composite= new SashForm(superComposite, SWT.HORIZONTAL);
	initializeDialogUnits(superComposite);
	GridData gd= new GridData(GridData.FILL_BOTH);
	gd.heightHint= convertHeightInCharsToPixels(20);
	gd.widthHint= convertWidthInCharsToPixels(10);
	composite.setLayoutData(gd);
	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);

	createSimilarElementTreeComposite(composite);
	createSourceViewerComposite(composite);
	composite.setWeights(new int[] { 50, 50 });
}
 
Example 2
Source File: LogContent.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
public LogContent(Composite parent, Log<T> log) {
  super(parent, SWT.NONE);

  this.log = log;

  setLayout(new FillLayout());
  SashForm sashForm = new SashForm(this, SWT.VERTICAL);

  createViewer(sashForm);
  createDetailsPane(sashForm, treeViewer.getTree().getBackground());

  sashForm.setWeights(new int[] {70, 30});

  revealChildrenThatNeedAttention(treeViewer, log.getRootLogEntry());

  LogEntry<T> entryToSelect = log.getFirstDeeplyNestedChildWithMaxAttn();
  if (entryToSelect != null) {
    treeViewer.setSelection(new StructuredSelection(entryToSelect));
  }
}
 
Example 3
Source File: SvnPropertiesView.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
 */
public void createPartControl(Composite parent) {
	GridLayout layout = new GridLayout();
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	layout.numColumns = 1;
	parent.setLayout(layout);		
	statusLabel = new Label(parent,SWT.LEFT);
	GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
	gridData.grabExcessHorizontalSpace = true;
	statusLabel.setLayoutData(gridData);

	SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
	sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
	tableViewer = createTable(sashForm);
	textViewer = createText(sashForm);
	sashForm.setWeights(new int[] { 70, 30 });

	contributeActions();        
       
       pageSelectionListener = new ISelectionListener() {
		public void selectionChanged(IWorkbenchPart part, ISelection selection) {
       		handlePartSelectionChanged(part,selection);
       	}
       };
       
       getSite().getPage().addPostSelectionListener(pageSelectionListener);
	resourceStateChangeListener = new ResourceStateChangeListener();
	SVNProviderPlugin.addResourceStateChangeListener(resourceStateChangeListener);
}
 
Example 4
Source File: Translator.java    From hop with Apache License 2.0 5 votes vote down vote up
public void open() {
  shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  shell.setText( APP_NAME );
  shell.setImage( GuiResource.getInstance().getImageLogoSmall() );

  try {
    readFiles();
  } catch ( Exception e ) {
    new ErrorDialog(
      shell, "Error reading translations", "There was an unexpected error reading the translations", e );
  }

  // Put something on the screen
  sashform = new SashForm( shell, SWT.HORIZONTAL );
  sashform.setLayout( new FormLayout() );

  addLists();
  addGrid();
  addListeners();

  sashform.setWeights( new int[] { 30, 70 } );
  sashform.setVisible( true );

  shell.pack();

  refresh();

  wPackages.optWidth( true );
  wPackages.getTable().getColumn( 1 ).setWidth( 1 );

  BaseTransformDialog.setSize( shell);

  shell.open();
}
 
Example 5
Source File: SvnRevPropertiesView.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
   * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
   */
  public void createPartControl(Composite parent) {
      GridLayout layout = new GridLayout();
      layout.marginWidth = 0;
      layout.marginHeight = 0;
      layout.numColumns = 1;
      parent.setLayout(layout);       
      statusLabel = new Label(parent,SWT.LEFT);
      GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
      gridData.grabExcessHorizontalSpace = true;
      statusLabel.setLayoutData(gridData);

      SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
      sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
      tableViewer = createTable(sashForm);
      textViewer = createText(sashForm);
      sashForm.setWeights(new int[] { 70, 30 });

      contributeActions();        
      
//      pageSelectionListener = new ISelectionListener() {
//          public void selectionChanged(IWorkbenchPart part, ISelection selection) {
//              handlePartSelectionChanged(part,selection);
//          }
//      };
//      
//      getSite().getPage().addPostSelectionListener(pageSelectionListener);
//      resourceStateChangeListener = new ResourceStateChangeListener();
//      SVNProviderPlugin.addResourceStateChangeListener(resourceStateChangeListener);
      
  }
 
Example 6
Source File: Composite3DModifier.java    From ldparteditor with MIT License 5 votes vote down vote up
/**
 * Splits this composite into two by creating a new
 * {@link org.eclipse.swt.custom.SashForm}, a new
 * {@link org.nschmidt.ldparteditor.composites.Composite3D} and including
 * the old composite in the west of the horizontal SashForm.
 */
public SashForm splitViewVertically() {
    NLogger.debug(Composite3DModifier.class, "[Split vertically]"); //$NON-NLS-1$

    int[] mainSashWeights = Editor3DWindow.getSashForm().getWeights();
    int[] superSashWeights = c3d.getSashForm().getWeights();

    boolean isUpperComposite;
    try {
        isUpperComposite = ((ScalableComposite) c3d.getSashForm().getChildren()[0]).getComposite3D().equals(c3d);
    } catch (ClassCastException e) {
        isUpperComposite = false;
    }

    final SashForm newParentSashForm = new SashForm(c3d.getSashForm(), SWT.HORIZONTAL);
    c3d.getCompositeContainer().setParent(newParentSashForm);

    CompositeContainer southComposite = new CompositeContainer(newParentSashForm, false, c3d.isSyncManipulator(), c3d.isSyncTranslation(), c3d.isSyncZoom());
    newParentSashForm.setWeights(new int[] { 1, 1 });
    southComposite.moveBelow(c3d.getCompositeContainer());

    if (isSashFormChild(newParentSashForm.getParent())) {
        if (isUpperComposite) {
            newParentSashForm.moveAbove(newParentSashForm.getParent().getChildren()[0]);
        } else {
            newParentSashForm.moveBelow(newParentSashForm.getParent().getChildren()[0]);
        }
    } else {
        newParentSashForm.moveBelow(newParentSashForm.getParent().getChildren()[0]);
    }
    newParentSashForm.getParent().layout();
    ((SashForm) newParentSashForm.getParent()).setWeights(superSashWeights);
    Editor3DWindow.getSashForm().setWeights(mainSashWeights);
    return newParentSashForm;
}
 
Example 7
Source File: Composite3DModifier.java    From ldparteditor with MIT License 5 votes vote down vote up
/**
 * Splits this composite into two by creating a new
 * {@link org.eclipse.swt.custom.SashForm}, a new
 * {@link org.nschmidt.ldparteditor.composites.Composite3D} and including
 * the old composite in the north of the vertical SashForm.
 */
public SashForm splitViewHorizontally() {
    NLogger.debug(Composite3DModifier.class, "[Split horizontally]"); //$NON-NLS-1$

    int[] mainSashWeights = Editor3DWindow.getSashForm().getWeights();
    int[] superSashWeights = c3d.getSashForm().getWeights();

    boolean isUpperComposite;
    try {
        isUpperComposite = ((ScalableComposite) c3d.getSashForm().getChildren()[0]).getComposite3D().equals(c3d);
    } catch (ClassCastException e) {
        isUpperComposite = false;
    }

    final SashForm newParentSashForm = new SashForm(c3d.getSashForm(), SWT.VERTICAL);
    c3d.getCompositeContainer().setParent(newParentSashForm);

    CompositeContainer southComposite = new CompositeContainer(newParentSashForm, false, c3d.isSyncManipulator(), c3d.isSyncTranslation(), c3d.isSyncZoom());
    newParentSashForm.setWeights(new int[] { 1, 1 });
    southComposite.moveBelow(c3d.getCompositeContainer());

    if (isSashFormChild(newParentSashForm.getParent())) {
        if (isUpperComposite) {
            newParentSashForm.moveAbove(newParentSashForm.getParent().getChildren()[0]);
        } else {
            newParentSashForm.moveBelow(newParentSashForm.getParent().getChildren()[0]);
        }
    } else {
        newParentSashForm.moveBelow(newParentSashForm.getParent().getChildren()[0]);
    }
    newParentSashForm.getParent().layout();
    ((SashForm) newParentSashForm.getParent()).setWeights(superSashWeights);
    Editor3DWindow.getSashForm().setWeights(mainSashWeights);
    return newParentSashForm;
}
 
Example 8
Source File: TreeNavigationView.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
public TreeNavigationView(Composite parent, int style) {
  super(parent, style);
  setLayout(new FillLayout(SWT.VERTICAL));

  sashForm = new SashForm(this, SWT.HORIZONTAL);
  contentTypes = new TreeViewer(sashForm);
  contentTypes.addSelectionChangedListener(new ISelectionChangedListener() {
    public void selectionChanged(SelectionChangedEvent event) {
      fireSelectionChangedEvent(event);
      
      Object contentPanelSelection = null;
      ISelection selection = contentTypes.getSelection();
      if (selection != null && !selection.isEmpty()) {
        contentPanelSelection = ((ITreeSelection) selection).getFirstElement();
      }
      
      contentPanel.setSelection(contentPanelSelection);
    }
  });
  
  contentPanel = new ContentPanel(sashForm, SWT.NONE);

  contentTypes.setComparator(new ModelNodeViewerComparator());
  sashForm.setWeights(new int[] {20, 80});
  contentTypes.setLabelProvider(new ModelLabelProvider());
  contentTypes.setContentProvider(new TreeContentProvider());
  contentTypes.getTree().addKeyListener(
      new EnterKeyTreeToggleKeyAdapter(contentTypes));
}
 
Example 9
Source File: LogAnalysis.java    From AndroidRobot with Apache License 2.0 5 votes vote down vote up
public void createSashForm() {
    sashFormLog = new SashForm(shell, SWT.HORIZONTAL);
    //sashFormLog.setBounds(10, 27, 672, 529);
    FormData formData = new FormData();
    formData.left = new FormAttachment(0, 3);
    formData.right = new FormAttachment(100, -3);
    formData.top = new FormAttachment(0, 25);
    formData.bottom = new FormAttachment(100, -25);
    sashFormLog.setLayoutData(formData);

    createLogList();
    createLogDetail();
    sashFormLog.setWeights(new int[] { 1, 2 });
}
 
Example 10
Source File: SimulationView.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createPartControl(Composite parent) {
	parent.setLayout(new FillLayout(SWT.VERTICAL));
	Composite top = kit.createComposite(parent);
	top.setLayout(new GridLayout(2, false));
	SashForm sash = new SashForm(top, SWT.VERTICAL | SWT.SMOOTH);
	sash.setSashWidth(2);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(sash);
	createSimulationSessionViewer(sash);
	createExecutionContextViewer(sash);
	sash.setWeights(new int[] { 1, 5 });
	IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
	addSimulationSessionActions(mgr);
	super.createPartControl(parent);
}
 
Example 11
Source File: HeaderPage.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Setup 2 column layout.
 *
 * @param managedForm the managed form
 * @param w1 the w 1
 * @param w2 the w 2
 * @return the form 2 panel
 */
public Form2Panel setup2ColumnLayout(IManagedForm managedForm, int w1, int w2) {
  final ScrolledForm sform = managedForm.getForm();
  final Composite form = sform.getBody();
  form.setLayout(new GridLayout(1, false)); // this is required !
  Composite xtra = toolkit.createComposite(form);
  xtra.setLayout(new GridLayout(1, false));
  xtra.setLayoutData(new GridData(GridData.FILL_BOTH));
  Control c = xtra.getParent();
  while (!(c instanceof ScrolledComposite))
    c = c.getParent();
  ((GridData) xtra.getLayoutData()).widthHint = c.getSize().x;
  ((GridData) xtra.getLayoutData()).heightHint = c.getSize().y;
  sashForm = new SashForm(xtra, SWT.HORIZONTAL);

  sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); // needed

  leftPanel = newComposite(sashForm);
  ((GridLayout) leftPanel.getLayout()).marginHeight = 5;
  ((GridLayout) leftPanel.getLayout()).marginWidth = 5;
  rightPanel = newComposite(sashForm);
  ((GridLayout) rightPanel.getLayout()).marginHeight = 5;
  ((GridLayout) rightPanel.getLayout()).marginWidth = 5;
  sashForm.setWeights(new int[] { w1, w2 });
  leftPanelPercent = (float) w1 / (float) (w1 + w2);
  rightPanelPercent = (float) w2 / (float) (w1 + w2);

  rightPanel.addControlListener(new ControlAdapter() {
    @Override
    public void controlResized(ControlEvent e) {
      setSashFormWidths();
    }
  });

  return new Form2Panel(form, leftPanel, rightPanel);
}
 
Example 12
Source File: Translator.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void open() {
  shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  shell.setText( APP_NAME );

  try {
    readFiles( ROOT );
  } catch ( Exception e ) {
    new ErrorDialog(
      shell, "Error reading translations", "There was an unexpected error reading the translations", e );
  }

  // Put something on the screen
  sashform = new SashForm( shell, SWT.HORIZONTAL );
  sashform.setLayout( new FillLayout() );

  addList();
  addGrid();
  addListeners();

  sashform.setWeights( new int[] { 30, 70 } );
  sashform.setVisible( true );

  refresh();

  BaseStepDialog.setSize( shell );

  shell.open();
}
 
Example 13
Source File: Translator2.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void open() {
  shell = new Shell( display );
  shell.setLayout( new FillLayout() );
  shell.setText( APP_NAME );
  shell.setImage( GUIResource.getInstance().getImageLogoSmall() );

  try {
    readFiles();
  } catch ( Exception e ) {
    new ErrorDialog(
      shell, "Error reading translations", "There was an unexpected error reading the translations", e );
  }

  // Put something on the screen
  sashform = new SashForm( shell, SWT.HORIZONTAL );
  sashform.setLayout( new FormLayout() );

  addLists();
  addGrid();
  addListeners();

  sashform.setWeights( new int[] { 40, 60 } );
  sashform.setVisible( true );

  shell.pack();

  refresh();

  shell.setSize( 1024, 768 );

  shell.open();
}
 
Example 14
Source File: NewSourceContainerWorkbookPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Adjust the size of the sash form.
 *
 * @param sashWeight the weight to be read or written
 * @param sashForm the sash form to apply the new weights to
 * @param isExpanded <code>true</code> if the expandable composite is
 * expanded, <code>false</code> otherwise
 */
private void adjustSashForm(int[] sashWeight, SashForm sashForm, boolean isExpanded) {
    if (isExpanded) {
        int upperWeight= sashWeight[0];
        sashForm.setWeights(new int[]{upperWeight, 100 - upperWeight});
    }
    else {
        // TODO Dividing by 10 because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=81939
        sashWeight[0]= sashForm.getWeights()[0] / 10;
        sashForm.setWeights(new int[]{95, 5});
    }
    sashForm.layout(true);
}
 
Example 15
Source File: SQLDataSetEditorPage.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @param pageContainer
 * @param left
 * @param right
 */
private void setWidthHints( SashForm pageContainer, Control left,
		Control right )
{
	int leftWidth = left.computeSize( SWT.DEFAULT, SWT.DEFAULT ).x;
	int rightWidth = right.computeSize( SWT.DEFAULT, SWT.DEFAULT ).x;

	pageContainer.setWeights( new int[]{
			leftWidth, rightWidth
	} );

}
 
Example 16
Source File: MessagingControl.java    From offspring with MIT License 4 votes vote down vote up
private void createControls() {
  setLayout(new FillLayout());

  SashForm form = new SashForm(this, SWT.VERTICAL);
  form.setLayout(new FillLayout());

  topComposite = new Composite(form, SWT.NONE);
  topComposite.setLayout(new FillLayout());

  bottomComposite = new Composite(form, SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(2).spacing(5, 0).margins(0, 0)
      .applyTo(bottomComposite);

  treeViewer = new MessagingTreeViewer(topComposite, accountId, null, nxt,
      engine, userService, sync);

  recipientsComposite = new Composite(bottomComposite, SWT.NONE);
  GridDataFactory.fillDefaults().grab(true, false)
      .align(SWT.FILL, SWT.CENTER).applyTo(recipientsComposite);
  // recipientsComposite.setBackground(Colors.getColor(Colors.YELLOW));
  recipientsComposite.setLayout(new RowLayout());

  replyButton = new Button(bottomComposite, SWT.PUSH);
  replyButton.setText("Reply to this message");
  GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER)
      .exclude(accountReadonly)
      .applyTo(replyButton);
  replyButton.addSelectionListener(new SelectionAdapter() {

    @Override
    public void widgetSelected(SelectionEvent e) {
      IStructuredSelection selection = (IStructuredSelection) treeViewer
          .getSelection();
      Object element = selection.getFirstElement();
      if (element instanceof IMessageNode) {
        IMessageNode node = (IMessageNode) element;
        MessageWrapper message = node.getMessage();

        Long transactionId = message.getId();
        Long recipientId;
        if (accountReadonly) {
          recipientId = message.getSenderId();
        }
        else {
          if (message.getSenderId().equals(accountId)) {
            recipientId = message.getReceipientId();
          }
          else {
            recipientId = message.getSenderId();
          }
        }
        openReplyDialog(recipientId, transactionId, message.isEncrypted());
      }
    }
  });

  messageText = new Text(bottomComposite, SWT.MULTI | SWT.BORDER | SWT.WRAP
      | SWT.V_SCROLL);
  messageText.setEditable(false);

  GridDataFactory.defaultsFor(messageText).align(SWT.FILL, SWT.FILL)
      .grab(true, true).span(3, 1)
      .applyTo(messageText);

  form.setWeights(new int[] { 60, 30 });
}
 
Example 17
Source File: MakrosComposite.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create the composite.
 * 
 * @param parent
 * @param style
 */
public MakrosComposite(Composite parent, int style){
	super(parent, style);
	setLayout(new GridLayout(1, false));
	
	CLabel lblHeader = new CLabel(this, SWT.NONE);
	lblHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	lblHeader.setText("Makros des Anwender " + CoreHub.getLoggedInContact().getLabel());

	
	SashForm sash = new SashForm(this, SWT.HORIZONTAL);
	sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	Composite selectionComposite = new Composite(sash, SWT.NONE);
	selectionComposite.setLayout(new GridLayout(1, true));
	ToolBarManager toolbar = new ToolBarManager();
	ToolBar toolbarControl = toolbar.createControl(selectionComposite);
	toolbarControl.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
	
	viewer = new TableViewer(selectionComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(new DefaultLabelProvider());
	viewer.setInput(getUserMakros(CoreHub.getLoggedInContact()));
	viewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event){
			StructuredSelection selection = (StructuredSelection) viewer.getSelection();
			if (selection != null && !selection.isEmpty()) {
				detailComposite.setMakro((MakroDTO) selection.getFirstElement());
			} else {
				detailComposite.setMakro(null);
			}
		}
	});
	viewer.setComparator(new ViewerComparator());
	
	MenuManager menuManager = new MenuManager();
	menuManager.add(new RemoveMakroAction(viewer));
	MenuManager subMenu = new MenuManager("Marko zu Anwender kopieren");
	subMenu.setRemoveAllWhenShown(true);
	subMenu.addMenuListener(new IMenuListener() {
		@Override
		public void menuAboutToShow(IMenuManager manager){
			addCopyToUserActions(manager);
		}
	});
	menuManager.add(subMenu);
	
	Menu menu = menuManager.createContextMenu(viewer.getTable());
	viewer.getTable().setMenu(menu);
	
	toolbar.add(new AddMakroAction(viewer));
	toolbar.add(new RemoveMakroAction(viewer));
	toolbar.add(new RefreshMakrosAction(viewer));
	toolbar.update(true);
	
	detailComposite = new MakroDetailComposite(sash, SWT.NONE);
	
	// can only be set after child components are available
	sash.setWeights(new int[] {
		1, 4
	});
}
 
Example 18
Source File: CmdPanel.java    From Rel with Apache License 2.0 4 votes vote down vote up
/**
 * Create the composite.
 * 
 * @param parent
 * @param cmdstyle
 * @throws IOException
 * @throws ClassNotFoundException
 * @throws NumberFormatException
 * @throws DatabaseFormatVersionException
 */
public CmdPanel(DbConnection connection, Composite parent, int cmdstyle)
		throws NumberFormatException, ClassNotFoundException, IOException, DatabaseFormatVersionException {
	super(parent, SWT.NONE);
	setLayout(new FillLayout(SWT.HORIZONTAL));

	sashForm = new SashForm(this, SWT.VERTICAL);

	cmdPanelOutput = new CmdPanelOutput(sashForm, connection, CmdPanelOutput.SHOW_SERVER_RESPONSE) {
		@Override
		protected void notifyInputDone() {
			cmdPanelInput.done();
			cmdPanelInput.setFocused();
		}

		@Override
		protected void notifyInputOfSuccess() {
			cmdPanelInput.selectAll();
			notifyExecuteSuccess();
			cmdPanelInput.setFocused();
		}

		@Override
		protected void notifyInputOfError(StringBuffer errorBuffer) {
			ErrorInformation eInfo = cmdPanelInput.handleError(errorBuffer);
			notifyError(eInfo);
		}

		@Override
		protected void zoom() {
			if (sashForm.getMaximizedControl() == null) {
				sashForm.setMaximizedControl(cmdPanelInput);
				zoomInParent();
			} else if (sashForm.getMaximizedControl() == cmdPanelInput) {
				sashForm.setMaximizedControl(cmdPanelOutput);
				zoomInParent();
			} else {
				sashForm.setMaximizedControl(null);
				unzoomInParent();
			}
		}

		@Override
		protected void notifyEnhancedOutputChange() {
			CmdPanel.this.notifyEnhancedOutputChange();
		}
	};
	cmdPanelInput = new CmdPanelInput(sashForm, cmdPanelOutput, cmdstyle, connection.getKeywords()) {
		@Override
		protected void notifyHistoryAdded(String historyItem) {
			CmdPanel.this.notifyHistoryAdded(historyItem);
		}

		@Override
		protected String getDefaultSaveFileName() {
			return CmdPanel.this.getDefaultSaveFileName();
		}
	};

	sashForm.setWeights(new int[] { 2, 1 });
}
 
Example 19
Source File: TransHistoryDelegate.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public TransHistoryLogTab( CTabFolder tabFolder, LogTableInterface logTable ) {
  super( tabFolder, SWT.NONE );
  setLogTable( logTable );

  setText( logTable.getLogTableType() );

  Composite logTableComposite = new Composite( tabFolder, SWT.NONE );
  logTableComposite.setLayout( new FormLayout() );
  spoon.props.setLook( logTableComposite );

  setControl( logTableComposite );

  SashForm sash = new SashForm( logTableComposite, SWT.VERTICAL );
  sash.setLayout( new FillLayout() );
  FormData fdSash = new FormData();
  fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdSash.top = new FormAttachment( 0, 0 );
  fdSash.right = new FormAttachment( 100, 0 );
  fdSash.bottom = new FormAttachment( 100, 0 );
  sash.setLayoutData( fdSash );

  logDisplayTableView = createTransLogTableView( sash );

  if ( logTable.getLogField() != null ) {
    logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
    spoon.props.setLook( logDisplayText );
    logDisplayText.setVisible( true );

    FormData fdText = new FormData();
    fdText.left = new FormAttachment( 0, 0 );
    fdText.top = new FormAttachment( 0, 0 );
    fdText.right = new FormAttachment( 100, 0 );
    fdText.bottom = new FormAttachment( 100, 0 );
    logDisplayText.setLayoutData( fdText );

    sash.setWeights( new int[] { 70, 30, } );
  } else {
    logDisplayText = null;
    sash.setWeights( new int[] { 100, } );
  }
}
 
Example 20
Source File: JobHistoryDelegate.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public JobHistoryLogTab( CTabFolder tabFolder, LogTableInterface logTable ) {
  super( tabFolder, SWT.NONE );
  setLogTable( logTable );

  setText( logTable.getLogTableType() );

  Composite logTableComposite = new Composite( tabFolder, SWT.NONE );
  logTableComposite.setLayout( new FormLayout() );
  spoon.props.setLook( logTableComposite );

  setControl( logTableComposite );

  SashForm sash = new SashForm( logTableComposite, SWT.VERTICAL );
  sash.setLayout( new FillLayout() );
  FormData fdSash = new FormData();
  fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdSash.top = new FormAttachment( 0, 0 );
  fdSash.right = new FormAttachment( 100, 0 );
  fdSash.bottom = new FormAttachment( 100, 0 );
  sash.setLayoutData( fdSash );

  logDisplayTableView = createJobLogTableView( sash );

  if ( logTable.getLogField() != null ) {
    logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY );
    spoon.props.setLook( logDisplayText );
    logDisplayText.setVisible( true );

    FormData fdText = new FormData();
    fdText.left = new FormAttachment( 0, 0 );
    fdText.top = new FormAttachment( 0, 0 );
    fdText.right = new FormAttachment( 100, 0 );
    fdText.bottom = new FormAttachment( 100, 0 );
    logDisplayText.setLayoutData( fdText );

    sash.setWeights( new int[] { 70, 30, } );
  } else {
    logDisplayText = null;
    sash.setWeights( new int[] { 100, } );
  }
}