Java Code Examples for org.eclipse.jface.viewers.TableViewerColumn#getColumn()
The following examples show how to use
org.eclipse.jface.viewers.TableViewerColumn#getColumn() .
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: QueryExpressionEditor.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private void createValueColumn(final TableViewer tableViewer) { final TableViewerColumn valueColumnViewer = new TableViewerColumn(tableViewer, SWT.FILL); final TableColumn column = valueColumnViewer.getColumn(); column.setText(Messages.value); final ExpressionColumnLabelProvider expressionLabelProvider = new ExpressionColumnLabelProvider(0); valueColumnViewer.setLabelProvider(new LabelProviderBuilder<Expression>() .withTextProvider(exp -> exp.getReferencedElements().isEmpty() ? null : expressionLabelProvider.getText(exp.getReferencedElements().get(0))) .withImageProvider(exp -> exp.getReferencedElements().isEmpty() ? null : expressionLabelProvider.getImage(exp.getReferencedElements().get(0))) .createColumnLabelProvider()); editingSupport = new ReferencedExpressionEditingSupport(valueColumnViewer.getViewer()); editingSupport.setFilter(new AvailableExpressionTypeFilter(new String[] { ExpressionConstants.CONSTANT_TYPE, ExpressionConstants.VARIABLE_TYPE, ExpressionConstants.PARAMETER_TYPE, ExpressionConstants.SCRIPT_TYPE, ExpressionConstants.CONTRACT_INPUT_TYPE })); valueColumnViewer.setEditingSupport(editingSupport); }
Example 2
Source File: MenuPage.java From EasyShell with Eclipse Public License 2.0 | 6 votes |
private void createColumns(final Composite parent, final TableViewer viewer) { TableViewerColumn viewerColumn1 = new TableViewerColumn(viewer, SWT.NONE); TableColumn column1 = viewerColumn1.getColumn(); column1.setText(Activator.getResourceString("easyshell.menu.page.header.title.column0")); column1.setWidth(200); column1.setResizable(true); column1.setMoveable(true); TableViewerColumn viewerColumn2 = new TableViewerColumn(viewer, SWT.NONE); TableColumn column2 = viewerColumn2.getColumn(); column2.setText(Activator.getResourceString("easyshell.menu.page.header.title.column1")); column2.setWidth(400); column2.setResizable(true); column2.setMoveable(true); }
Example 3
Source File: MedicationViewerHelper.java From elexis-3-core with Eclipse Public License 1.0 | 6 votes |
public static TableViewerColumn createDosageColumn(TableViewer viewer, TableColumnLayout layout, int columnIndex){ TableViewerColumn ret = new TableViewerColumn(viewer, SWT.NONE); ret.setLabelProvider(new MedicationCellLabelProvider() { @Override public String getText(Object element){ MedicationTableViewerItem pres = (MedicationTableViewerItem) element; String dosis = pres.getDosis(); return (dosis.equals(StringConstants.ZERO) ? Messages.MedicationComposite_stopped : dosis); } }); TableColumn tblclmnDosage = ret.getColumn(); tblclmnDosage.setToolTipText(Messages.TherapieplanComposite_tblclmnDosage_toolTipText); tblclmnDosage.addSelectionListener(getSelectionAdapter(viewer, tblclmnDosage, columnIndex)); layout.setColumnData(tblclmnDosage, new ColumnPixelData(60, true, true)); ret.getColumn().setText(Messages.TherapieplanComposite_tblclmnDosage_text); return ret; }
Example 4
Source File: ParameterEditor.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
private void createTableViewer(final Composite parent) { final Label filler = new Label(mainComposite, SWT.NONE); filler.setLayoutData( GridDataFactory.fillDefaults().span(2, 1).indent(0, -LayoutConstants.getSpacing().y + 1).create()); viewer = new TableViewer(mainComposite, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); final TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100, false)); viewer.getTable().setLayout(layout); viewer.getTable().setLayoutData( GridDataFactory.fillDefaults().grab(true, true).span(2, 1).create()); final TableViewerColumn columnViewer = new TableViewerColumn(viewer, SWT.NONE); final TableColumn column = columnViewer.getColumn(); column.setText(Messages.name); final TableColumnSorter sorter = new TableColumnSorter(viewer); sorter.setColumn(column); viewer.getTable().setHeaderVisible(true); viewer.setContentProvider(new ArrayContentProvider()); viewer.setLabelProvider(new ParameterNameLabelProvider()); viewer.addPostSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(final SelectionChangedEvent event) { if (!event.getSelection().isEmpty()) { ParameterEditor.this.fireSelectionChanged(); } } }); }
Example 5
Source File: MaplayerTableViewer.java From gama with GNU General Public License v3.0 | 5 votes |
private TableViewerColumn createTableViewerColumn(final String title, final int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(this, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 6
Source File: ViewStatisticsQuality.java From arx with Apache License 2.0 | 5 votes |
/** * Creates a new column * @param table * @param name * @param width * @param provider */ private TableViewerColumn createColumn(PageableTable table, String name, ColumnLabelProvider provider) { TableViewerColumn column = new TableViewerColumn(table.getViewer(), SWT.NONE); column.setLabelProvider(provider); TableColumn tColumn = column.getColumn(); tColumn.setToolTipText(name); tColumn.setText(name); tColumn.setWidth(30); tColumn.setResizable(false); return column; }
Example 7
Source File: OneRendererPaginationTableWithPageableTableExample.java From nebula with Eclipse Public License 2.0 | 5 votes |
private static TableViewerColumn createTableViewerColumn( TableViewer viewer, String title, int bound) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 8
Source File: OneRendererPaginationTableAtHandExample.java From nebula with Eclipse Public License 2.0 | 5 votes |
private static TableViewerColumn createTableViewerColumn( TableViewer viewer, String title, int bound) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 9
Source File: SelectUserMappingWizardPage.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void createControl(final Composite parent) { super.createControl(parent); final Composite mainComposite = (Composite) getControl(); final Composite viewersComposite = new Composite(mainComposite, SWT.NONE); viewersComposite.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).span(2, 1).hint(SWT.DEFAULT, 250).create()); viewersComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(5, 5).extendedMargins(0, 0, 10, 0).create()); availableUserViewer = CheckboxTableViewer.newCheckList(viewersComposite, SWT.BORDER | SWT.FULL_SELECTION); availableUserViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create()); availableUserViewer.getTable().setHeaderVisible(true); availableUserViewer.setContentProvider(new ArrayContentProvider()); final TableLayout layout = new TableLayout(); layout.addColumnData(new ColumnWeightData(100)); availableUserViewer.getTable().setLayout(layout); final TableViewerColumn columnViewer = new TableViewerColumn(availableUserViewer, SWT.NONE); final TableColumn usernameColumn = columnViewer.getColumn(); usernameColumn.setText(Messages.userName); columnViewer.setLabelProvider(new ColumnLabelProvider()); final TableColumnSorter sorter = new TableColumnSorter(availableUserViewer); sorter.setColumn(usernameColumn); availableUserViewer.setInput(availableUsers); availableUserViewer.setCheckedElements(selectedUsers.toArray()); }
Example 10
Source File: InvoiceCorrectionView.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
private TableViewerColumn createTableViewerColumn(String title, int bound, int colIdx){ final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); TableColumn column = viewerColumn.getColumn(); column.setText(title); tableColumnLayout.setColumnData(column, new ColumnWeightData(bound, ColumnWeightData.MINIMUM_WIDTH, true)); column.setResizable(true); column.setMoveable(false); viewerColumn.setLabelProvider(new DefaultColumnLabelProvider(colIdx)); return viewerColumn; }
Example 11
Source File: DashboardView.java From MergeProcessor with Apache License 2.0 | 4 votes |
/** * @param parent a widget which will be the parent of the new instance (cannot * be null) * @param style the style of widget to construct */ public DashboardView(Composite parent, int style) { super(parent, style); setLayout(new GridLayout()); final Composite tableComposite = new Composite(this, SWT.NONE); final TableColumnLayout tableColumnLayout = new TableColumnLayout(); tableComposite.setLayout(tableColumnLayout); tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI); final Table table = tableViewer.getTable(); table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); table.setLinesVisible(true); table.setHeaderVisible(true); statusViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn statusColumn = statusViewerColumn.getColumn(); tableColumnLayout.setColumnData(statusColumn, new ColumnPixelData(70)); statusColumn.setText(Messages.View_Column_Status); hostViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn hostColumn = hostViewerColumn.getColumn(); tableColumnLayout.setColumnData(hostColumn, new ColumnPixelData(120)); hostColumn.setText(Messages.View_Column_Host); repositoryViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn repositoryColumn = repositoryViewerColumn.getColumn(); tableColumnLayout.setColumnData(repositoryColumn, new ColumnPixelData(110)); repositoryColumn.setText(Messages.View_Column_Repository); dateViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn dateColumn = dateViewerColumn.getColumn(); tableColumnLayout.setColumnData(dateColumn, new ColumnPixelData(130)); dateColumn.setText(Messages.View_Column_Date); revisionViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn revisionColumn = revisionViewerColumn.getColumn(); tableColumnLayout.setColumnData(revisionColumn, new ColumnPixelData(100)); revisionColumn.setText(Messages.View_Column_Revision_Range); sourceBranchViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn sourceBranchColumn = sourceBranchViewerColumn.getColumn(); tableColumnLayout.setColumnData(sourceBranchColumn, new ColumnPixelData(120)); sourceBranchColumn.setText(Messages.View_Column_Source_Branch); targetBranchViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn targetBranchColumn = targetBranchViewerColumn.getColumn(); tableColumnLayout.setColumnData(targetBranchColumn, new ColumnPixelData(120)); targetBranchColumn.setText(Messages.View_Column_Target_Branch); mergeScriptViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn mergeScriptColumn = mergeScriptViewerColumn.getColumn(); tableColumnLayout.setColumnData(mergeScriptColumn, new ColumnPixelData(0)); mergeScriptColumn.setText(Messages.View_Column_Merge_Script); renameStatusViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE); final TableColumn renameColumn = renameStatusViewerColumn.getColumn(); tableColumnLayout.setColumnData(renameColumn, new ColumnPixelData(23)); renameColumn.setText(Messages.View_Column_Renaming); final Composite buttonComposite = new Composite(this, SWT.NONE); buttonComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); buttonComposite.setLayout(new FillLayout()); btnMergeSelection = new Button(buttonComposite, SWT.PUSH); btnMergeSelection.setText(Messages.View_Button_Merge_Selection); btnIgnoreSelection = new Button(buttonComposite, SWT.PUSH); btnIgnoreSelection.setText(Messages.View_Button_Ignore_Selection); }
Example 12
Source File: SdkEnvironmentControl.java From xds-ide with Eclipse Public License 1.0 | 4 votes |
/** * Create the composite. * @param parent * @param style * @param editedSdk */ public SdkEnvironmentControl(Composite parent, int style, final Sdk editedSdk) { super(parent, style); this.editedSdk = editedSdk; selectedVar = null; setLayoutData(new GridData(GridData.FILL_BOTH)); setLayout(SwtUtils.removeMargins(new GridLayout(2, false))); Composite tableComposite = new Composite(this, SWT.NONE); tableComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); tableComposite.setLayout(new GridLayout(1, false)); tableComposite.setBackground(new Color(Display.getDefault(), 255,0,0)); tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); TableColumnLayout tableColumnLayout = new TableColumnLayout(); tableComposite.setLayout(tableColumnLayout); tableViewer = new TableViewer(tableComposite, SWT.BORDER | SWT.FULL_SELECTION); table = tableViewer.getTable(); table.setHeaderVisible(true); table.setLinesVisible(true); columnName = new TableViewerColumn(tableViewer, SWT.NONE); tblclmnName = columnName.getColumn(); tableColumnLayout.setColumnData(tblclmnName, new ColumnPixelData(150, true, true)); tblclmnName.setText(Messages.SdkEnvironmentControl_Variable); columnLocation = new TableViewerColumn(tableViewer, SWT.NONE); tblclmnLocation = columnLocation.getColumn(); tableColumnLayout.setColumnData(tblclmnLocation, new ColumnPixelData(150, true, true)); tblclmnLocation.setText(Messages.SdkEnvironmentControl_Value); tableViewer.setContentProvider(new SdkEnvContentProvider()); tableViewer.setLabelProvider(new SdkEnvLabelProvider()); tableViewer.addSelectionChangedListener(new ISelectionChangedListener() { @Override public void selectionChanged(SelectionChangedEvent event) { TableItem[] selectedItems = table.getSelection(); boolean isEnabled = selectedItems.length > 0; btnEdit.setEnabled(isEnabled); btnDelete.setEnabled(isEnabled); selectedVar = isEnabled ? (String)selectedItems[0].getData() : null; } }); Composite buttonsComposite = new Composite(this, SWT.NONE); buttonsComposite.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1)); buttonsComposite.setLayout(SwtUtils.removeMargins(new GridLayout(1, false))); btnNew = SWTFactory.createPushButton(buttonsComposite, Messages.SdkEnvironmentControl_New, null); btnNew.addSelectionListener(new AddVarButtonHandler()); btnEdit = SWTFactory.createPushButton(buttonsComposite, Messages.SdkEnvironmentControl_Edit, null); btnEdit.addSelectionListener(new EditValueButtonHandler()); btnEdit.setEnabled(false); btnDelete = SWTFactory.createPushButton(buttonsComposite, Messages.SdkEnvironmentControl_Delete, null); btnDelete.setEnabled(false); btnDelete.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (selectedVar != null) { editedSdk.removeEnvironmentVariable(selectedVar); tableViewer.setInput(editedSdk); } } }); tableViewer.setInput(editedSdk); }
Example 13
Source File: SelectGroupMappingWizardPage.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
@Override public void createControl(Composite parent) { super.createControl(parent) ; final Composite mainComposite = (Composite) getControl(); final Composite viewersComposite = new Composite(mainComposite, SWT.NONE) ; viewersComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).hint(SWT.DEFAULT,250).create()) ; viewersComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).extendedMargins(0, 0, 10, 0).equalWidth(false).create()) ; availableGroupViewer = CheckboxTableViewer.newCheckList(viewersComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL) ; availableGroupViewer.getTable().setLayoutData(GridDataFactory.fillDefaults().grab(true,true).create()) ; availableGroupViewer.getTable().setHeaderVisible(true) ; availableGroupViewer.setContentProvider(new ArrayContentProvider()) ; final TableLayout layout = new TableLayout() ; layout.addColumnData(new ColumnWeightData(100)); availableGroupViewer.getTable().setLayout(layout) ; final TableViewerColumn columnViewer = new TableViewerColumn(availableGroupViewer, SWT.NONE) ; final TableColumn usernameColumn = columnViewer.getColumn() ; usernameColumn.setText(Messages.groupName); columnViewer.setLabelProvider(new ColumnLabelProvider()); final TableColumnSorter sorter = new TableColumnSorter(availableGroupViewer) ; sorter.setColumn(usernameColumn) ; availableGroupViewer.setInput(availableGroups) ; availableGroupViewer.setCheckedElements(selectedGroups.toArray()); context = new DataBindingContext(); final IObservableSet checkedElementsObservable = ViewersObservables.observeCheckedElements(availableGroupViewer, String.class) ; final MultiValidator notEmptyValidator = new MultiValidator() { @Override protected IStatus validate() { if(groupSelectionIsValid(checkedElementsObservable)){ return ValidationStatus.ok(); } return ValidationStatus.error(Messages.errorSelectionGroups); } } ; context.addValidationStatusProvider(notEmptyValidator); context.bindSet(checkedElementsObservable, PojoObservables.observeSet(this, "selectedGroups")); WizardPageSupport.create(this, context); setControl(mainComposite); }
Example 14
Source File: PreMachineTranslationResultDialog.java From translationstudio8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 15
Source File: LockRepeatedSegmentResultDialog.java From translationstudio8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 16
Source File: NewProjectTbPage.java From translationstudio8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 17
Source File: ProjectSettingTBPage.java From translationstudio8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 18
Source File: PreTranslationResultDialog.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 19
Source File: NewProjectTmPage.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }
Example 20
Source File: ExportTmxDialog.java From tmxeditor8 with GNU General Public License v2.0 | 3 votes |
/** * 设置TableViewer 列属性 * @param viewer * @param title * 列标题 * @param bound * 列宽 * @param colNumber * 列序号 * @return {@link TableViewerColumn}; */ private TableViewerColumn createTableViewerColumn(TableViewer viewer, String title, int bound, final int colNumber) { final TableViewerColumn viewerColumn = new TableViewerColumn(viewer, SWT.NONE | SWT.Resize); final TableColumn column = viewerColumn.getColumn(); column.setText(title); column.setWidth(bound); column.setResizable(true); column.setMoveable(true); return viewerColumn; }