Java Code Examples for org.eclipse.swt.layout.GridData#FILL

The following examples show how to use org.eclipse.swt.layout.GridData#FILL . 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: RelationDialog.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * This method initializes group1
 * 
 */
private void createChildGroup(Composite composite, int size) {
	GridLayout gridLayout = new GridLayout();
	gridLayout.marginHeight = 10;
	gridLayout.verticalSpacing = 10;

	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;

	Group group = new Group(composite, SWT.NONE);
	group.setLayoutData(gridData);
	group.setLayout(gridLayout);

	group.setText(ResourceString.getResourceString("label.child"));

	Label filler = new Label(group, SWT.NONE);
	filler.setText("");
	GridData fillerGridData = new GridData();
	fillerGridData.heightHint = size;
	filler.setLayoutData(fillerGridData);

	this.createChildMandatoryGroup(group);
}
 
Example 2
Source File: RelationshipDialog.java    From erflute with Apache License 2.0 6 votes vote down vote up
/**
 * This method initializes group1
 */
private void createChildGroup(Composite composite, int size) {
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginHeight = 10;
    gridLayout.verticalSpacing = 10;

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    final Group group = new Group(composite, SWT.NONE);
    group.setLayoutData(gridData);
    group.setLayout(gridLayout);

    group.setText(DisplayMessages.getMessage("label.child"));

    final Label filler = new Label(group, SWT.NONE);
    filler.setText("");
    final GridData fillerGridData = new GridData();
    fillerGridData.heightHint = size;
    filler.setLayoutData(fillerGridData);

    createChildMandatoryGroup(group);
}
 
Example 3
Source File: CompositeFactory.java    From erflute with Apache License 2.0 6 votes vote down vote up
public static Composite createChildComposite(Composite parent, int height, int span, int numColumns) {
    final Composite composite = new Composite(parent, SWT.NONE);
    final GridData gridData = new GridData();
    gridData.horizontalSpan = span;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    if (height >= 0) {
        gridData.heightHint = height;
    }
    composite.setLayoutData(gridData);
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginWidth = 0;
    gridLayout.numColumns = numColumns;
    composite.setLayout(gridLayout);
    return composite;
}
 
Example 4
Source File: SearchDialog.java    From erflute with Apache License 2.0 6 votes vote down vote up
private void initialize(Composite parent) {
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 3;
    gridLayout.verticalSpacing = 15;

    createKeywordCombo(parent);

    createReplaceCombo(parent);

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 3;
    gridData.grabExcessHorizontalSpace = true;

    this.tabFolder = new TabFolder(parent, SWT.NONE);
    tabFolder.setLayoutData(gridData);

    createRegionGroup(tabFolder);
    createResultGroup(tabFolder);

    parent.setLayout(gridLayout);

    selectAllCheckBox(true);
}
 
Example 5
Source File: RelationDialog.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
private void createChildMandatoryGroup(final Group parent) {
    final GridLayout gridLayout = new GridLayout();
    gridLayout.marginHeight = 10;

    final GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;

    final Group group = new Group(parent, SWT.NONE);
    group.setLayout(gridLayout);
    group.setLayoutData(gridData);
    group.setText(ResourceString.getResourceString("label.mandatory"));

    childCardinalityCombo = new Combo(group, SWT.NONE);
    childCardinalityCombo.setLayoutData(gridData);

    childCardinalityCombo.setVisibleItemCount(5);

    childCardinalityCombo.add("1..n");
    childCardinalityCombo.add("0..n");
    childCardinalityCombo.add(Relation.CHILD_CARDINALITY_1);
    childCardinalityCombo.add("0..1");
}
 
Example 6
Source File: ConfigurationFormToolkit.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
public void createStandardCombo ( final Composite parent, final String attributeName, final String label, final String[] items, final IObservableMap data, final Object valueType )
{
    this.toolkit.createLabel ( parent, label + ":" );

    final Combo combo = new Combo ( parent, SWT.DROP_DOWN );

    combo.setItems ( items );
    this.toolkit.adapt ( combo );

    final GridData gd = new GridData ( GridData.FILL, GridData.BEGINNING, true, true );
    gd.horizontalSpan = 2;
    combo.setLayoutData ( gd );

    final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
    this.dbc.bindValue ( WidgetProperties.text ().observe ( combo ), value );
}
 
Example 7
Source File: IndexDialog.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
private void initializeIndexColumnList(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.verticalSpan = 2;
    gridData.verticalAlignment = GridData.FILL;
    gridData.grabExcessVerticalSpace = true;

    indexColumnList = new Table(parent, SWT.FULL_SELECTION | SWT.BORDER);
    indexColumnList.setHeaderVisible(true);
    indexColumnList.setLayoutData(gridData);
    indexColumnList.setLinesVisible(false);

    final TableColumn tableColumn = new TableColumn(indexColumnList, SWT.CENTER);
    tableColumn.setWidth(150);
    tableColumn.setText(ResourceString.getResourceString("label.column.name"));

    if (DBManagerFactory.getDBManager(table.getDiagram()).isSupported(DBManager.SUPPORT_DESC_INDEX)) {
        final TableColumn tableColumn1 = new TableColumn(indexColumnList, SWT.CENTER);
        tableColumn1.setWidth(50);
        tableColumn1.setText(ResourceString.getResourceString("label.order.desc"));
    }
}
 
Example 8
Source File: DiffMergePreferencePage.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * creates a Text control
 */
private Text createText(Composite parent, int widthHint) {
    Text textControl = new Text(parent, SWT.SINGLE | SWT.BORDER);
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.widthHint = widthHint;
    gridData.grabExcessHorizontalSpace = true;
    textControl.setLayoutData(gridData);
    return textControl;
}
 
Example 9
Source File: SWTFactory.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Sets width and height hint for the button control. <b>Note:</b> This is a NOP if the button's layout data is not
 * an instance of <code>GridData</code>.
 * 
 * @param the
 *            button for which to set the dimension hint
 */
public static void setButtonDimensionHint(Button button)
{
	Object gd = button.getLayoutData();
	if (gd instanceof GridData)
	{
		((GridData) gd).widthHint = getButtonWidthHint(button);
		((GridData) gd).horizontalAlignment = GridData.FILL;
	}
}
 
Example 10
Source File: TestDataDialog.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
private void createNameComposite(final Composite parent) {
    final Composite nameComposite = new Composite(parent, SWT.NONE);
    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    nameComposite.setLayoutData(gridData);

    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    nameComposite.setLayout(layout);

    nameText = CompositeFactory.createText(this, nameComposite, "label.testdata.name", true, true);
}
 
Example 11
Source File: ExportToDDLDialog.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
private void createCreateCheckboxGroup(Composite parent) {
	Group group = new Group(parent, SWT.NONE);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.verticalAlignment = GridData.FILL;
	gridData.grabExcessVerticalSpace = true;
	group.setLayoutData(gridData);

	group.setText("CREATE");

	GridLayout layout = new GridLayout();
	layout.numColumns = 2;
	group.setLayout(layout);

	this.createTablespace = CompositeFactory.createCheckbox(this, group,
			"label.tablespace");
	this.createSequence = CompositeFactory.createCheckbox(this, group,
			"label.sequence");
	this.createTrigger = CompositeFactory.createCheckbox(this, group,
			"label.trigger");
	this.createView = CompositeFactory.createCheckbox(this, group,
			"label.view");
	this.createIndex = CompositeFactory.createCheckbox(this, group,
			"label.index");
	this.createTable = CompositeFactory.createCheckbox(this, group,
			"label.table");
	this.createForeignKey = CompositeFactory.createCheckbox(this, group,
			"label.foreign.key");
	this.createComment = CompositeFactory.createCheckbox(this, group,
			"label.comment");
}
 
Example 12
Source File: ConstructorFieldPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private void createComboComp() {
    FillLayout fillLayout = new FillLayout();
    fillLayout.type = org.eclipse.swt.SWT.VERTICAL;
    GridData gridData7 = new GridData();
    gridData7.horizontalSpan = 2;
    gridData7.verticalAlignment = GridData.CENTER;
    gridData7.grabExcessHorizontalSpace = true;
    gridData7.horizontalAlignment = GridData.FILL;
    comboComp = new Composite(mainComp, SWT.NONE);
    comboComp.setLayoutData(gridData7);
    comboComp.setLayout(fillLayout);
    methodInsertionLbl = new CLabel(comboComp, SWT.NONE);
    methodInsertionLbl.setText(Messages.offsetStrategyInsertionPointMethod);
    methodInsertionComb = createComboViewer(comboComp);
    methodInsertionComb.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            if (!sel.isEmpty()) {
                OffsetStrategyModel elem = (OffsetStrategyModel) sel.getFirstElement();
                getRequestProcessor().setMethodDestination(elem.getStrategy());
            }
        }
    });

    getRequestProcessor().setMethodDestination(strategyProvider.get(0).getStrategy());
    methodInsertionComb.getCombo().select(0);
}
 
Example 13
Source File: IndexTabWrapper.java    From erflute with Apache License 2.0 5 votes vote down vote up
private void createBody(Composite content) {
    final GridData contentGridData = new GridData();
    contentGridData.horizontalAlignment = GridData.FILL;
    contentGridData.grabExcessHorizontalSpace = true;
    content.setLayoutData(contentGridData);
    content.setLayout(new GridLayout(3, false));
    initTable(content);
    initTableButton(content);
    setTableData();
}
 
Example 14
Source File: CommitSetDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected Label createWrappingLabel(Composite parent, String text) {
	Label label = new Label(parent, SWT.LEFT | SWT.WRAP);
	label.setText(text);
	GridData data = new GridData();
	data.horizontalSpan = 1;
	data.horizontalAlignment = GridData.FILL;
	data.horizontalIndent = 0;
	data.grabExcessHorizontalSpace = true;
	data.widthHint = 200;
	label.setLayoutData(data);
	return label;
}
 
Example 15
Source File: ExpandWithConstructorsDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite composite) {
	fConfigurationBlock= new ExpandWithConstructorsConfigurationBlock(new IStatusChangeListener() {
		public void statusChanged(IStatus status) {
			//Do nothing

		}
	}, null);
	GridData data= new GridData(GridData.FILL, GridData.FILL, true, true);
	fConfigurationBlockControl= fConfigurationBlock.createContents(composite);
	fConfigurationBlockControl.setLayoutData(data);

	Dialog.applyDialogFont(composite);
	return composite;
}
 
Example 16
Source File: BeginnerTaskQuestionPage.java    From CogniCrypt with Eclipse Public License 2.0 5 votes vote down vote up
private Group createNote(final Composite parent, final Question question, boolean visible) {
	final Group notePanel = new Group(parent, SWT.NONE);
	notePanel.setText("Note:");
	final GridLayout gridLayout = new GridLayout();
	notePanel.setLayout(gridLayout);
	final GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
	gridData.horizontalSpan = 1;
	notePanel.setLayoutData(gridData);
	final Font boldFont = new Font(notePanel.getDisplay(), new FontData(Constants.ARIAL, 10, SWT.BOLD));
	notePanel.setFont(boldFont);
	notePanel.pack();
	setControl(parent);

	Text note = new Text(notePanel, SWT.MULTI | SWT.WRAP);
	note.setLayoutData(new GridData(GridData.FILL_BOTH));
	String noteText = question.getNote();
	if (noteText.contains("$$$")) {
		noteText = noteText.split("\\$\\$\\$")[1];
	}
	note.setText(noteText);
	note.pack();
	note.setBounds(10, 20, 585, 60);
	note.setSize(note.computeSize(585, SWT.DEFAULT));
	setControl(notePanel);
	note.setEditable(false);
	note.setEnabled(true);
	notePanel.setVisible(visible);
	return notePanel;
}
 
Example 17
Source File: RelationshipDialog.java    From erflute with Apache License 2.0 5 votes vote down vote up
private void createOnDeleteCombo(Group group) {
    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    onDeleteCombo = new Combo(group, SWT.NONE);
    onDeleteCombo.setLayoutData(gridData);

    onDeleteCombo.add("RESTRICT");
    onDeleteCombo.add("CASCADE");
    onDeleteCombo.add("NO ACTION");
    onDeleteCombo.add("SET NULL");
    onDeleteCombo.add("SET DEFAULT");
}
 
Example 18
Source File: Layouts.java    From offspring with MIT License 4 votes vote down vote up
public static GridData fill(boolean grabExcessHorizontalSpace, boolean grabExcessVerticalSpace) {
  GridData gd = new GridData(GridData.FILL, GridData.FILL, grabExcessHorizontalSpace, grabExcessVerticalSpace);
  return gd;
}
 
Example 19
Source File: WeekHeader.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * This method initializes this
 * 
 */
private void initialize() {
	this.setSize(new org.eclipse.swt.graphics.Point(536, 54));
	GridData gridData6 = new GridData();
	gridData6.horizontalAlignment = GridData.FILL;
	gridData6.grabExcessHorizontalSpace = true;
	gridData6.verticalAlignment = GridData.CENTER;
	GridData gridData5 = new GridData();
	gridData5.horizontalAlignment = GridData.FILL;
	gridData5.grabExcessHorizontalSpace = true;
	gridData5.verticalAlignment = GridData.CENTER;
	GridData gridData4 = new GridData();
	gridData4.horizontalAlignment = GridData.FILL;
	gridData4.grabExcessHorizontalSpace = true;
	gridData4.verticalAlignment = GridData.CENTER;
	GridData gridData3 = new GridData();
	gridData3.horizontalAlignment = GridData.FILL;
	gridData3.grabExcessHorizontalSpace = true;
	gridData3.verticalAlignment = GridData.CENTER;
	GridData gridData2 = new GridData();
	gridData2.horizontalAlignment = GridData.FILL;
	gridData2.grabExcessHorizontalSpace = true;
	gridData2.verticalAlignment = GridData.CENTER;
	GridData gridData1 = new GridData();
	gridData1.horizontalAlignment = GridData.FILL;
	gridData1.grabExcessHorizontalSpace = true;
	gridData1.verticalAlignment = GridData.CENTER;
	GridData gridData = new GridData();
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.verticalAlignment = GridData.CENTER;
	setLayout(new GridLayout(7, true));
	label = new Label(this, SWT.CENTER);
	label.setBounds(new org.eclipse.swt.graphics.Rectangle(23, 18, 53, 18));
	label.setLayoutData(gridData6);
	label.setText("Monday");
	label1 = new Label(this, SWT.CENTER);
	label1.setBounds(new org.eclipse.swt.graphics.Rectangle(98, 18, 79, 17));
	label1.setLayoutData(gridData5);
	label1.setText("Tuesday");
	label2 = new Label(this, SWT.CENTER);
	label2.setBounds(new org.eclipse.swt.graphics.Rectangle(187, 18, 47, 17));
	label2.setLayoutData(gridData4);
	label2.setText("Wednesday");
	label3 = new Label(this, SWT.CENTER);
	label3.setBounds(new org.eclipse.swt.graphics.Rectangle(256, 17, 67, 17));
	label3.setLayoutData(gridData3);
	label3.setText("Thursday");
	label4 = new Label(this, SWT.CENTER);
	label4.setBounds(new org.eclipse.swt.graphics.Rectangle(338, 17, 62, 20));
	label4.setLayoutData(gridData2);
	label4.setText("Friday");
	label5 = new Label(this, SWT.CENTER);
	label5.setBounds(new org.eclipse.swt.graphics.Rectangle(415, 16, 43, 21));
	label5.setLayoutData(gridData1);
	label5.setText("Saturday");
	label6 = new Label(this, SWT.CENTER);
	label6.setBounds(new org.eclipse.swt.graphics.Rectangle(469, 16, 61, 23));
	label6.setLayoutData(gridData);
	label6.setText("Sunday");

}
 
Example 20
Source File: ParameterizeDialog.java    From http4e with Apache License 2.0 4 votes vote down vote up
protected Control createDialogArea( Composite parent){
   // Composite composite = (Composite) super.createDialogArea(parent);
   // text = new StyledText(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL |
   // SWT.H_SCROLL);
   // GridData spec = new GridData();
   // spec.heightHint = HEIGHT;
   // spec.widthHint = WEIGHT;
   // spec.horizontalAlignment = GridData.FILL;
   // spec.grabExcessHorizontalSpace = true;
   // spec.verticalAlignment = GridData.FILL;
   // spec.grabExcessVerticalSpace = true;
   // text.setLayoutData(spec);
   // // text.setForeground(ResourceUtils.getColor(GRAY_RGB_TEXT));
   // text.setText("#Typing \"myArg=xyz\" here " +
   // "\n# and \"myArg={?}\" or \"myArg={myArg}\" at Header/Param area " +
   // "\n# the latter will get automatically injected with \"myArg\" value.");

   // final boolean[] isClicked = {false};
   // text.addMouseListener(new MouseListener(){
   //
   // public void mouseDoubleClick( MouseEvent e){
   // // TODO Auto-generated method stub
   //            
   // }
   //
   // public void mouseDown( MouseEvent e){
   // if(!isClicked[0]){
   // text.setText("");
   // text.setForeground(ResourceUtils.getColor(GRAY_NORMAL_TEXT));
   // }
   // isClicked[0] = true;
   // }
   //
   // public void mouseUp( MouseEvent e){
   // }
   // });

   ParameterizeTextView pView = new ParameterizeTextView(parent);
   this.text = (StyledText) pView.getControl();

   GridData spec = new GridData();
   spec.heightHint = HEIGHT;
   spec.widthHint = WEIGHT;
   spec.horizontalAlignment = GridData.FILL;
   spec.grabExcessHorizontalSpace = true;
   spec.verticalAlignment = GridData.FILL;
   spec.grabExcessVerticalSpace = true;
   text.setLayoutData(spec);

   CoreContext ctx = CoreContext.getContext();
   Map<String, String> parArgs = (Map<String, String>) ctx.getObject(CoreObjects.PARAMETERIZE_ARGS);
   if (parArgs == null || parArgs.isEmpty()) {
      text.setText(  "#############################################################\n"+
                     "#       Providing \"@something=123\" here \n"+
                     "#\n"+
                     "#       and \"header1=@something\" at Headers panel \n"+
                     "#\n"+
                     "#       or \"param1=@something\" at Params panel \n"+
                     "#\n"+
                     "#       the latter will be substituted with the \"@something\" value.\n"+
                     "#############################################################\n");
   } else {
      StringBuilder sb = new StringBuilder();
      for (String key : parArgs.keySet()) {
         sb.append(key + "=" + BaseUtils.noNull(parArgs.get(key)) + "\n");
      }
      text.setText(sb.toString());
   }

   return text;
}