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

The following are Jave code examples for showing how to use setLinesVisible() 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.
Example 1
Project: n4js   File: TableViewerBuilder.java   Source Code and License Vote up 6 votes
@Override
protected TableViewer createViewer(final Composite parent, final AbstractColumnLayout columnLayout, final int style) {
	final TableViewer viewer = new TableViewer(parent, style);
	final Table table = viewer.getTable();
	table.setLinesVisible(linesVisible);
	table.setHeaderVisible(headerVisible);

	int columnIndex = 0;
	for (final String columnLabel : columnLabels) {

		final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, NONE);
		final TableColumn column = viewerColumn.getColumn();
		columnLayout.setColumnData(column, createColumnLayoutData(columnIndex));
		column.setText(columnLabel);
		column.setMoveable(moveable);

		columnIndex++;
	}

	return viewer;
}
 
Example 2
Project: eZooKeeper   File: DataModelFormPage.java   Source Code and License Vote up 6 votes
protected Section createTableSection(ScrolledForm form, Composite client, FormToolkit toolkit, String title,
        Image image, int sectionStyle, int tableStyle, String[] columnTitles, int[] columnAlignments) {

    Section section = createSection(form, client, toolkit, title, image, sectionStyle);
    Table table = toolkit.createTable(section, tableStyle);

    for (int i = 0; i < columnTitles.length; i++) {
        TableColumn column = new TableColumn(table, SWT.NONE);
        column.setText(columnTitles[i]);
        column.setAlignment(columnAlignments[i]);
    }

    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    section.setClient(table);

    return section;
}
 
Example 3
Project: convertigo-eclipse   File: ArrayEditorComposite.java   Source Code and License 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 4
Project: convertigo-eclipse   File: TableEditorComposite.java   Source Code and License 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: XMLTableWizardPage.java   Source Code and License 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 6
Project: convertigo-eclipse   File: SqlConnectorComposite.java   Source Code and License 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 7
Project: Hydrograph   File: WidgetUtility.java   Source Code and License Vote up 5 votes
/**
 * Creates the table columns.
 * 
 * @param table
 *            the table
 * @param fields
 *            the fields
 */
public static void createTableColumns(Table table,String[] fields){
	for (String field : fields) {
		TableColumn tc = new TableColumn(table, SWT.CENTER);
		tc.setText(field);
		tc.setMoveable(true);
	}
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
}
 
Example 8
Project: Hydrograph   File: ELTSWTWidgets.java   Source Code and License Vote up 5 votes
public TableViewer createTableViewer(Composite composite, String[] prop,
		int[] bounds, int columnWidth,
		IStructuredContentProvider iStructuredContentProvider,
		ITableLabelProvider iTableLabelProvider) {
	final TableViewer tableViewer = new TableViewer(composite, SWT.BORDER
			| SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);

	Table table = tableViewer.getTable();
	table.setBounds(bounds[0], bounds[1], bounds[2], bounds[3]);
	tableViewer.setContentProvider(iStructuredContentProvider);
	tableViewer.setLabelProvider(iTableLabelProvider);
	tableViewer.setColumnProperties(prop);
	tableViewer.getTable().addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.keyCode == SWT.ARROW_UP) {
				e.doit = false;
			} else if (e.keyCode == SWT.ARROW_DOWN) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_NEXT) {
				e.doit = false;
			} else if (e.keyCode == SWT.TRAVERSE_ARROW_PREVIOUS) {
				e.doit = false;
			}

		}
	});

	table.setVisible(true);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	/*
	 * createTableColumns(table,prop, columnWidth); CellEditor[] editors
	 * =createCellEditorList(table,1); tableViewer.setCellEditors(editors);
	 */

	return tableViewer;
}
 
Example 9
Project: Hydrograph   File: ELTSWTWidgets.java   Source Code and License Vote up 5 votes
public void createTableColumns(Table table, String[] fields, int width) {
	for (String field : fields) {
		TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
		tableColumn.setText(field);
		tableColumn.setWidth(width);
		// tableColumn.pack();
	}
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

}
 
Example 10
Project: visuflow-plugin   File: ResultView.java   Source Code and License Vote up 5 votes
private void createViewer(Composite parent) {
	viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER | SWT.CHECK | SWT.READ_ONLY | SWT.PUSH);
	createColumns(parent, viewer);
	final Table table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	viewer.getTable().addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(org.eclipse.swt.widgets.Event event) {
			if (highlightNodes.getSelection())
				highlightNodesOnGraph(highlightNodes.getSelection());
		}
	});

	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setInput(this.units);
	getSite().setSelectionProvider(viewer);

	GridData gridData = new GridData();
	gridData.verticalAlignment = GridData.FILL;
	gridData.horizontalSpan = 2;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;
	viewer.getControl().setLayoutData(gridData);

	Hashtable<String, Object> properties = new Hashtable<>();
	String[] topics = new String[] { DataModel.EA_TOPIC_DATA_SELECTION, DataModel.EA_TOPIC_DATA_UNIT_CHANGED, DataModel.EA_TOPIC_DATA_VIEW_REFRESH };
	properties.put(EventConstants.EVENT_TOPIC, topics);
	ServiceUtil.registerService(EventHandler.class, this, properties);

}
 
Example 11
Project: Hydrograph   File: ELTOperationClassDialog.java   Source Code and License Vote up 5 votes
public static void createTableColumns(Table table, String[] fields) {
	for (String field : fields) {
		TableColumn tableColumn = new TableColumn(table, SWT.FILL);
		tableColumn.setText(field);

		tableColumn.setWidth(100);
		tableColumn.pack();
	}
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
}
 
Example 12
Project: Hydrograph   File: JoinMapDialog.java   Source Code and License 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 13
Project: Hydrograph   File: LookupMapDialog.java   Source Code and License 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 14
Project: Hydrograph   File: SecondaryColumnKeysDialog.java   Source Code and License 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 15
Project: Hydrograph   File: TransformDialog.java   Source Code and License Vote up 5 votes
public static void createTableColumns(Table table, String[] fields) {
	for (String field : fields) {
		TableColumn tableColumn = new TableColumn(table, SWT.LEFT);
		tableColumn.setText(field);

		tableColumn.setWidth(100);
		tableColumn.pack();
	}
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
}
 
Example 16
Project: Hydrograph   File: DebugDataWizard.java   Source Code and License Vote up 5 votes
private void createTableColumns(Table table, String[] fields, int width) {
	for (String field : fields) {
		TableColumn tableColumn = new TableColumn(table, SWT.LEFT|SWT.BOLD);
		tableColumn.setText(field);
		tableColumn.setWidth(width);
	}
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

}
 
Example 17
Project: eZooKeeper   File: BaseZnodeModelTableFormPage.java   Source Code and License Vote up 4 votes
protected Table createTable(IManagedForm managedForm, Composite client) {
    FormToolkit toolkit = managedForm.getToolkit();
    Table table = toolkit.createTable(client, getTableStyle());
    table.setLinesVisible(true);
    return table;
}
 
Example 18
Project: Hydrograph   File: DebugDataViewer.java   Source Code and License 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();
		}
	}
}
 
Example 19
Project: Hydrograph   File: ViewDataUniqueIdDialog.java   Source Code and License Vote up 4 votes
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.getShell().setText("ViewData Execution History");
	container.setLayout(new GridLayout(1, false));
	
	
	Composite composite1 = new Composite(container, SWT.BORDER);
	GridData gd_scrolledComposite1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
	gd_scrolledComposite1.heightHint = 236;
	gd_scrolledComposite1.widthHint = 844;
	composite1.setLayoutData(gd_scrolledComposite1);
	
	table = new Table(composite1, SWT.BORDER | SWT.Selection | SWT.FULL_SELECTION );
	table.setBounds(0, 0, 842, 234);
	table.setHeaderVisible(true);
	table.setLinesVisible(true);
	
    for (int i = 0; i < titles.length; i++) {
      TableColumn column = new TableColumn(table, SWT.NONE);
      column.setWidth(212);
      column.setText(titles[i]);
    }
	
    jobDetails.sort((job1, job2)-> job2.getUniqueJobID().compareTo(job1.getUniqueJobID()));
    
    for(JobDetails job : jobDetails){
   		String timeStamp = getTimeStamp(job.getUniqueJobID());
   		TableItem items = new TableItem(table, SWT.None);
   		items.setText(0, job.getUniqueJobID());
   		items.setText(1, timeStamp);
   		String mode = getJobExecutionMode(job.isRemote());
   		items.setText(2, mode);
   		items.setText(3, job.getJobStatus());
    }
    
    table.addListener(SWT.Selection, new Listener() {
		@Override
		public void handleEvent(Event event) {
			TableItem[] item = table.getSelection();
			 for (int i = 0; i < item.length; i++){
				 TableItem selectedItem = item[i];
				 selectedUniqueJobId = selectedItem.getText();
		      }
		}
	});
	return super.createDialogArea(parent);
}
 
Example 20
Project: eZooKeeper   File: ZnodeModelChildrenFormPage.java   Source Code and License Vote up 3 votes
@Override
protected Table createTable(IManagedForm managedForm, Composite client) {

    final Table table = super.createTable(managedForm, client);
    table.setLinesVisible(false);
    ElementTypes elementTypes = new ElementTypes();

    elementTypes.add(ZnodeModel.class, _ZnodeModelElementType);

    _TableViewer = ViewerFactory.createDataModelTableViewer(table, elementTypes, null);

    makeTableActions();
    hookTableContextMenu();

    table.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDown(MouseEvent e) {

            getSite().getWorkbenchWindow().getActivePage().activate(getEditor());

            // if (table.getItem(new Point(e.x, e.y)) == null) {
            // _TableViewer.setSelection(null);
            // }
        }

    });

    return table;
}