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

The following examples show how to use org.eclipse.swt.custom.SashForm#setLayout() . 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: DashboardComposite.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
/** {@code key} defines which data source will be used for display. */
public DashboardComposite(String key, Composite parent, int style) {
	super(parent, style);
	this.key = key;

	this.setLayout(new FillLayout());

	final SashForm sf = new SashForm(this, SWT.HORIZONTAL);
	sf.setLayout(new FillLayout());

	this.canvas = new VisualisationCanvas(sf, SWT.NONE);

	this.text = new Text(sf, SWT.LEFT | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
	text.setText("");

	createVisualisationControls(sf);
	sf.setWeights(new int[] { 45, 45, 10 });
}
 
Example 2
Source File: GroovyEditorDocumentationDialogTray.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Control createContents(final Composite parent) {

    final Composite mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).create());

    createFunctionCategories(mainComposite);

    final SashForm sashForm = new SashForm(mainComposite, SWT.VERTICAL);
    sashForm.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(250, 250).minSize(100, SWT.DEFAULT).create());
    final GridLayout gridLaout = GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 2).create();
    sashForm.setLayout(gridLaout);
    createFunctionsList(sashForm);
    createFunctionDocumentaion(sashForm);

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

    return mainComposite;
}
 
Example 3
Source File: SQLDataSetEditorPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * create page control for sql edit page
 * 
 * @param parent
 * @return
 */
private Control createPageControl( Composite parent )
{
	SashForm pageContainer = new SashForm( parent, SWT.NONE );

	GridLayout layout = new GridLayout( );
	layout.numColumns = 3;
	layout.marginWidth = 0;
	layout.marginHeight = 0;
	layout.horizontalSpacing = 2;
	pageContainer.setLayout( layout );
	pageContainer.setLayoutData( new GridData( GridData.FILL_BOTH ) );

	pageContainer.setSashWidth( 3 );

	Control left = createDBMetaDataSelectionComposite( pageContainer );
	Control right = createTextualQueryComposite( pageContainer );
	setWidthHints( pageContainer, left, right );
	
	return pageContainer;
}
 
Example 4
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 5
Source File: PullUpMethodPage.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createTreeAndSourceViewer(final Composite superComposite) {
	final SashForm composite= new SashForm(superComposite, SWT.HORIZONTAL);
	initializeDialogUnits(superComposite);
	final GridData gd= new GridData(GridData.FILL_BOTH);
	gd.heightHint= convertHeightInCharsToPixels(20);
	gd.widthHint= convertWidthInCharsToPixels(10);
	composite.setLayoutData(gd);
	final GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	layout.horizontalSpacing= 1;
	layout.verticalSpacing= 1;
	composite.setLayout(layout);

	createHierarchyTreeComposite(composite);
	createSourceViewerComposite(composite);
	composite.setWeights(new int[] { 50, 50});
}
 
Example 6
Source File: TaskSelectType.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
protected void placeComponents( )
{
	foSashForm = new SashForm( topControl, SWT.VERTICAL );
	{
		GridLayout layout = new GridLayout( );
		foSashForm.setLayout( layout );
		GridData gridData = new GridData( GridData.FILL_BOTH );
		// TODO verify Bug 194391 in Linux
		gridData.heightHint = 680;
		foSashForm.setLayoutData( gridData );
	}
	createTopPreviewArea( foSashForm );
	createBottomTypeArea( foSashForm );
	
	initUIPropertiesAndData( );
}
 
Example 7
Source File: FileSetEditDialog.java    From eclipse-cs with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * @see org.eclipse.swt.widgets.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createDialogArea(Composite parent) {

  Composite composite = (Composite) super.createDialogArea(parent);
  composite.setLayoutData(new GridData(GridData.FILL_BOTH));
  Composite dialog = new Composite(composite, SWT.NONE);
  dialog.setLayout(new GridLayout(1, false));
  dialog.setLayoutData(new GridData(GridData.FILL_BOTH));

  Control commonArea = createCommonArea(dialog);
  commonArea.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  SashForm sashForm = new SashForm(dialog, SWT.VERTICAL);
  GridData gd = new GridData(GridData.FILL_BOTH);
  gd.widthHint = 500;
  gd.heightHint = 400;
  sashForm.setLayoutData(gd);
  sashForm.setLayout(new GridLayout());

  Control patternArea = createFileMatchPatternPart(sashForm);
  patternArea.setLayoutData(new GridData(GridData.FILL_BOTH));

  Control matchArea = createTestArea(sashForm);
  matchArea.setLayoutData(new GridData(GridData.FILL_BOTH));

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

  // init the data
  initializeControls();

  return composite;
}
 
Example 8
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 9
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 10
Source File: ImpactNwPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private SashForm createSash(Composite client) {
	SashForm sash = new SashForm(client, SWT.NONE);
	GridData sashGD = new GridData(SWT.FILL, SWT.FILL, true, true);
	sashGD.widthHint = 400;
	sash.setLayoutData(sashGD);
	sash.setLayout(new GridLayout(2, false));
	return sash;
}
 
Example 11
Source File: SvnWizardLockPage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public void createControls(Composite composite) {
       SashForm sashForm = new SashForm(composite, SWT.VERTICAL);
       GridLayout gridLayout = new GridLayout();
       gridLayout.marginHeight = 0;
       gridLayout.marginWidth = 0;
       sashForm.setLayout(gridLayout);
       sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));
               
       Composite cTop = new Composite(sashForm, SWT.NULL);
       GridLayout topLayout = new GridLayout();
       topLayout.marginHeight = 0;
       topLayout.marginWidth = 0;
       cTop.setLayout(topLayout);
       cTop.setLayoutData(new GridData(GridData.FILL_BOTH));
               
       Composite cBottom1 = new Composite(sashForm, SWT.NULL);
       GridLayout bottom1Layout = new GridLayout();
       bottom1Layout.marginHeight = 0;
       bottom1Layout.marginWidth = 0;
       cBottom1.setLayout(bottom1Layout);
       cBottom1.setLayoutData(new GridData(GridData.FILL_BOTH));
       
       Composite cBottom2 = new Composite(cBottom1, SWT.NULL);
       GridLayout bottom2Layout = new GridLayout();
       bottom2Layout.marginHeight = 0;
       bottom2Layout.marginWidth = 0;	        
       cBottom2.setLayout(bottom2Layout);
       cBottom2.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	commitCommentArea.createArea(cTop);
       
       addResourcesArea(cBottom2);
       
       setPageComplete(canFinish());

	// set F1 help
	PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.LOCK_DIALOG);	
}
 
Example 12
Source File: AbstractTwoColumnEditorPropertySection.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createControls(Composite parent) {
	parent.setLayout(new FillLayout());
	SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL | SWT.SMOOTH);
	sashForm.setSashWidth(2);
	sashForm.setBackground(sashForm.getDisplay().getSystemColor( SWT.COLOR_GRAY));
	sashForm.setLayout(new FillLayout());
	Composite leftColumn = getToolkit().createComposite(sashForm);
	leftColumn.setLayout(createLeftColumnLayout());
	Composite rightColumn = getToolkit().createComposite(sashForm);
	rightColumn.setLayout(createRightColumnLayout());
	sashForm.setWeights(new int[] { 1, 1 });
	createLeftColumnControls(leftColumn);
	createRightColumnControls(rightColumn);
}
 
Example 13
Source File: SelectExamplePage.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void createControl(Composite parent) {
	getShell().setBounds(calculatePosition(WIZARD_SIZE_SCALE_FACOTR, WIZARD_SIZE_OFFSET));
	Composite root = new Composite(parent, SWT.NONE);
	root.setLayout(new GridLayout(1, true));
	createUpdateGroup(root);
	SashForm container = new SashForm(root, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
	GridLayout layout = new GridLayout(2, false);
	container.setLayout(layout);
	createTreeViewer(container);
	createDetailsPane(container);
	container.setWeights(new int[] { 1, 2 });
	setControl(container);
	parent.layout();
}
 
Example 14
Source File: ItemView.java    From http4e with Apache License 2.0 5 votes vote down vote up
private Control buildBottomControl( final Composite parent){
   Composite bottom = new Composite(parent, SWT.NULL);
   FillLayout layout = new FillLayout();
   bottom.setLayout(layout);
   bottom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));

   vSash = new SashForm(bottom, SWT.HORIZONTAL);
   vSash.setLayout(layout);

   Composite leftBottom = new Composite(vSash, SWT.NULL);
   leftBottom.setLayout(new FillLayout(SWT.VERTICAL));
   hSash = new SashForm(leftBottom, SWT.VERTICAL);
   hSash.setLayout(layout);

   requestView = new RequestView(model, vSash);
   responseView = new ResponseView(model, vSash);

   vSash.setWeights(model.getVSashWeights());

   headerView = new HeaderView(model, hSash);
   paramView = new ParamView(model, hSash);
   bodyView = new BodyView(model, hSash);

   hSash.setWeights(model.getHSashWeights());

   return bottom;
}
 
Example 15
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 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: 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, } );
  }
}
 
Example 18
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, } );
  }
}