Java Code Examples for org.eclipse.swt.widgets.Table.setLayoutData()

The following are Jave code examples for showing how to use setLayoutData() of the org.eclipse.swt.widgets.Table class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: n4js   File: InterfacesComponentProvider.java   View Source Code Vote up 5 votes
/**
 * Creates a new interfaces component inside the parent composite using the given model.
 *
 * @param interfacesContainingModel
 *            A interface containing model
 * @param container
 *            The component container
 */
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
		WizardComponentContainer container) {
	super(container);
	this.model = interfacesContainingModel;

	Composite parent = getParentComposite();

	Label interfacesLabel = new Label(parent, SWT.NONE);

	GridData interfacesLabelGridData = fillLabelDefaults();
	interfacesLabelGridData.verticalAlignment = SWT.TOP;
	interfacesLabel.setLayoutData(interfacesLabelGridData);

	interfacesLabel.setText("Interfaces:");

	interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
	interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
	interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());

	interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());

	interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
	interfacesAddButton.setText("Add...");
	interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

	interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
	interfacesRemoveButton.setText("Remove");
	interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

	setupBindings();
}
 
Example 2
Project: eZooKeeper   File: DataModelTableFormPage.java   View Source Code Vote up 5 votes
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {

    Table table = createTable(client);
    configureTable(table);
    table.setLayoutData(getTableFormData());

    _TableViewer = createTableViewer(table);
}
 
Example 3
Project: eZooKeeper   File: ZooKeeperConnectionComposite2.java   View Source Code Vote up 5 votes
@Override
protected void createContents() {

    Label authInfoLabel = new Label(this, SWT.LEAD);
    authInfoLabel.setText("Auth Info:");
    authInfoLabel.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    _AuthInfoComposite = new ZooKeeperConnectionAuthInfoComposite(this, SWT.NULL);
    _AuthInfoComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    GridLayout authInfoCompositeLayout = new GridLayout(2, false);
    authInfoCompositeLayout.marginWidth = 0;
    authInfoCompositeLayout.marginHeight = 0;
    authInfoCompositeLayout.horizontalSpacing = ((GridLayout) getLayout()).horizontalSpacing;
    _AuthInfoComposite.setLayout(authInfoCompositeLayout);

    Table table = new Table(_AuthInfoComposite, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL
            | SWT.V_SCROLL);
    GridData tableLayoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
    tableLayoutData.heightHint = 200;
    table.setLayoutData(tableLayoutData);
    _AuthInfoComposite.setTable(table);

    Button addButton = new Button(_AuthInfoComposite, SWT.NULL);
    addButton.setText("Add...");
    addButton.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, false, false));
    _AuthInfoComposite.setAddButton(addButton);

    final Button removeButton = new Button(_AuthInfoComposite, SWT.NULL);
    removeButton.setText("Remove");
    removeButton.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, false, false));
    _AuthInfoComposite.setRemoveButton(removeButton);

    _AuthInfoComposite.init();
}
 
Example 4
Project: convertigo-eclipse   File: ArrayEditorComposite.java   View Source Code Vote up 5 votes
/**
 * This method initializes table	
 *
 */
private void createTable() {
	int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | 
	SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
	
	table = new Table(this, style);
	
	GridData gridData = new GridData(GridData.FILL_BOTH);
	gridData.grabExcessVerticalSpace = true;
	gridData.horizontalSpan = 3;
	table.setLayoutData(gridData);		
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
}
 
Example 5
Project: convertigo-eclipse   File: TableEditorComposite.java   View Source Code Vote up 5 votes
/**
 * This method initializes table	
 *
 */
private void createTable() {
	int style = SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | 
	SWT.FULL_SELECTION | SWT.HIDE_SELECTION;
	
	table = new Table(this, style);
	
	GridData gridData = new GridData(GridData.FILL_BOTH);
	gridData.grabExcessVerticalSpace = true;
	gridData.horizontalSpan = 3;
	table.setLayoutData(gridData);		
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
}
 
Example 6
Project: convertigo-eclipse   File: XMLTableWizardPage.java   View Source Code Vote up 5 votes
private void createTable(Composite parent) {
	GridData gridData = new GridData();
	gridData.horizontalSpan = numColumns;
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.verticalAlignment = GridData.FILL;
	table = new Table(parent, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	table.setLayoutData(gridData);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
}
 
Example 7
Project: convertigo-eclipse   File: SqlConnectorComposite.java   View Source Code Vote up 5 votes
private void createTable() {
	GridData gridData = new org.eclipse.swt.layout.GridData();
	gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
	table = new Table(this, SWT.VIRTUAL | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	table.setLayoutData(gridData);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
}
 
Example 8
Project: Hydrograph   File: SchemaPreviewPage.java   View Source Code Vote up 5 votes
@Override
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
			
	setControl(container);
	container.setLayout(new GridLayout(1, false));
	
	grpSchemaPreview = new Group(container, SWT.NONE);
	grpSchemaPreview.setText(SCHEMA_PREVIEW);
	grpSchemaPreview.setLayout(new GridLayout(1, false));
	grpSchemaPreview.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	composite = new Composite(grpSchemaPreview, SWT.NONE);
	composite.setLayout(new GridLayout(1, false));
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	availableFieldTableViewer=new TableViewer(composite,SWT.BORDER);
	
	TableViewerColumn availableFieldsColumn = new TableViewerColumn(availableFieldTableViewer, SWT.NONE);
	availableFieldsColumn.setLabelProvider(new AvailableFieldsColumnLabelProvider());
	TableColumn tableColumn = availableFieldsColumn.getColumn();
	tableColumn.setText(AVAILABLE_FIELDS);
	
	Table table=availableFieldTableViewer.getTable();
	table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	addControlListener(table, tableColumn);
   }
 
Example 9
Project: Hydrograph   File: JoinMapDialog.java   View Source Code Vote up 5 votes
private Table createMappingTable(Composite composite_6) {
	mappingTableViewer = new TableViewer(composite_6, SWT.BORDER
			| SWT.FULL_SELECTION | SWT.MULTI);
	Table table = mappingTableViewer.getTable();
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gd_table.widthHint = 374;
	table.setLayoutData(gd_table);
	mappingTableViewer.setContentProvider(new ArrayContentProvider());
	ColumnViewerToolTipSupport.enableFor(mappingTableViewer);
	return table;
}
 
Example 10
Project: Hydrograph   File: LookupMapDialog.java   View Source Code Vote up 5 votes
private Table createMappingTable(Composite composite_6) {
	mappingTableViewer = new TableViewer(composite_6, SWT.BORDER
			| SWT.FULL_SELECTION | SWT.MULTI);
	Table table = mappingTableViewer.getTable();
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gd_table.widthHint = 374;
	table.setLayoutData(gd_table);
	mappingTableViewer.setContentProvider(new ArrayContentProvider());
	ColumnViewerToolTipSupport.enableFor(mappingTableViewer);
	return table;
}
 
Example 11
Project: Hydrograph   File: SecondaryColumnKeysDialog.java   View Source Code Vote up 5 votes
private void createSourceTable(Composite composite_2) {
	sourceTable = new Table(composite_2, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
	sourceTable.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			if(sourceTable.getSelection().length==1){
				addNewProperty(targetTableViewer, sourceTable.getSelection()[0].getText());
				enableControlButtons();
			}
		}
	});
	GridData gd_table = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 2);
	gd_table.widthHint = 221;
	gd_table.heightHint = 407;
	sourceTable.setLayoutData(gd_table);
	sourceTable.setHeaderVisible(true);
	sourceTable.setLinesVisible(true);

	TableColumn sourceTableColumnFieldName = new TableColumn(sourceTable, SWT.LEFT);
	if(OSValidator.isMac()){
		sourceTableColumnFieldName.setWidth(212);
	}else{
		sourceTableColumnFieldName.setWidth(202);
	}
	
	sourceTableColumnFieldName.setText(Messages.AVAILABLE_FIELDS_HEADER);
	getSourceFieldsFromPropagatedSchema(sourceTable);
	dragSource = new DragSource(sourceTable, DND.DROP_MOVE);
	dragSource.setTransfer(new Transfer[] { TextTransfer.getInstance() });
	dragSource.addDragListener(new DragSourceAdapter() {
		public void dragSetData(DragSourceEvent event) {
			// Set the data to be the first selected item's text
			event.data = formatDataToTransfer(sourceTable.getSelection());
		}

	});
}
 
Example 12
Project: eZooKeeper   File: TableViewerOrchestrationZooKeeperConnectionModelFormPage.java   View Source Code Vote up 4 votes
@Override
protected void createModelFormContent(IManagedForm managedForm, Composite client) {

    FormToolkit toolkit = managedForm.getToolkit();

    _TableViewerOrchestrationComposite = createTableViewerOrchestrationComposite(client);
    toolkit.adapt(_TableViewerOrchestrationComposite);

    FormLayout compositeLayout = new FormLayout();
    compositeLayout.marginHeight = 0;
    compositeLayout.marginWidth = 0;
    compositeLayout.spacing = 8;
    _TableViewerOrchestrationComposite.setLayout(compositeLayout);
    _TableViewerOrchestrationComposite.setLayoutData(client.getLayoutData());

    Table table = toolkit.createTable(_TableViewerOrchestrationComposite, SWT.SINGLE | SWT.FULL_SELECTION
            | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    _TableViewerOrchestrationComposite.setTable(table);

    Button addButton = toolkit.createButton(_TableViewerOrchestrationComposite, "&Add", SWT.PUSH);
    _TableViewerOrchestrationComposite.setAddButton(addButton);

    Button removeButton = toolkit.createButton(_TableViewerOrchestrationComposite, "&Remove", SWT.PUSH);
    _TableViewerOrchestrationComposite.setRemoveButton(removeButton);

    FormData tableFormData = new FormData();
    tableFormData.top = new FormAttachment(0, 0);
    tableFormData.left = new FormAttachment(0, 0);
    tableFormData.bottom = new FormAttachment(100, 0);
    tableFormData.right = new FormAttachment(addButton, 0, SWT.LEFT);
    table.setLayoutData(tableFormData);

    FormData addButtonFormData = new FormData();
    addButtonFormData.top = new FormAttachment(0, 0);
    addButtonFormData.left = new FormAttachment(removeButton, 0, SWT.LEFT);
    addButtonFormData.right = new FormAttachment(100, 0);
    addButton.setLayoutData(addButtonFormData);

    FormData removeButtonFormData = new FormData();
    removeButtonFormData.top = new FormAttachment(addButton, 0);
    removeButtonFormData.right = new FormAttachment(100, 0);
    removeButton.setLayoutData(removeButtonFormData);

    _TableViewerOrchestrationComposite.addOrchestrationCompositeListener(new IOrchestrationCompositeListener() {

        @Override
        public void orchestrationChange(EventObject e) {
            setDirtyInternal(true);
        }
    });

    _TableViewerOrchestrationComposite.init();

}
 
Example 13
Project: Hydrograph   File: DebugDataViewer.java   View Source Code Vote up 4 votes
private void createHorizantalViewTabItem() {
	CTabItem tbtmHorizantalView = new CTabItem(tabFolder, SWT.CLOSE);
	tbtmHorizantalView.setData(Views.VIEW_NAME_KEY, Views.HORIZONTAL_VIEW_NAME);
	tbtmHorizantalView.setText(Views.HORIZONTAL_VIEW_DISPLAY_NAME);
	{
		Composite composite = new Composite(tabFolder, SWT.NONE);
		tbtmHorizantalView.setControl(composite);
		composite.setLayout(new GridLayout(1, false));
		{
			ScrolledComposite scrolledComposite = new ScrolledComposite(composite, SWT.BORDER | SWT.H_SCROLL
					| SWT.V_SCROLL);
			scrolledComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
			scrolledComposite.setExpandHorizontal(true);
			scrolledComposite.setExpandVertical(true);

			Composite stackLayoutComposite = new Composite(scrolledComposite, SWT.NONE);
			StackLayout stackLayout = new StackLayout();
			stackLayoutComposite.setLayout(stackLayout);

			{
				Composite composite_4 = new Composite(stackLayoutComposite, SWT.NONE);
				GridLayout gl_composite_4 = new GridLayout(1, false);
				gl_composite_4.verticalSpacing = 0;
				gl_composite_4.marginWidth = 0;
				gl_composite_4.marginHeight = 0;
				gl_composite_4.horizontalSpacing = 0;
				composite_4.setLayout(gl_composite_4);
				{
					horizontalViewTableViewer = new TableViewer(composite_4, SWT.BORDER | SWT.FULL_SELECTION);
					Table table_1 = horizontalViewTableViewer.getTable();
					table_1.setLinesVisible(true);
					table_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
				}
				stackLayout.topControl = composite_4;
			}

			scrolledComposite.getShowFocusedControl();
			scrolledComposite.setShowFocusedControl(true);

			scrolledComposite.setContent(stackLayoutComposite);
			scrolledComposite.setMinSize(stackLayoutComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT));

			installMouseWheelScrollRecursively(scrolledComposite);

			setTableLayoutToMappingTable(horizontalViewTableViewer);
			horizontalViewTableViewer.setContentProvider(new ArrayContentProvider());

			dataViewLoader.updateDataViewLists();
			horizontalViewTableViewer.setInput(gridViewData);
			horizontalViewTableViewer.refresh();

			for (int i = 0, n = horizontalViewTableViewer.getTable().getColumnCount(); i < n; i++)
				horizontalViewTableViewer.getTable().getColumn(i).pack();

			horizontalViewTableViewer.refresh();
		}
	}
}