use of org.eclipse.swt.widgets.TableColumn in project ow by vtst.
the class ValidatorPageHelper method createContents.
// **************************************************************************
// User interface
public Control createContents(Composite parent) {
Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
checkbox = SWTFactory.createCheckButton(composite, "Customize errors and warnings:", null, false, 1);
checkbox.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent _) {
}
@Override
public void widgetSelected(SelectionEvent _) {
updateListStatus();
}
});
list = new Table(composite, SWT.V_SCROLL | SWT.CHECK | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 1;
list.setLayoutData(gd);
TableColumn column1 = new TableColumn(list, SWT.NONE);
try {
fillList();
} catch (CoreException e) {
showErrorMessage("Cannot read properties from the current project", e);
}
column1.pack();
return composite;
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class DiagStatusMonitorTemplateDialog method createTableSelectedItem.
/**
* This method initializes tableSelectedItem
*
*/
private void createTableSelectedItem() {
TableLayout tlayout = new TableLayout();
tlayout.addColumnData(new ColumnWeightData(150, 150, true));
tlayout.addColumnData(new ColumnWeightData(150, 150, true));
tagetTbl.setLayout(tlayout);
TableColumn categoryColumn = new TableColumn(tagetTbl, SWT.CENTER);
categoryColumn.setText(DIAG_CATEGORY);
TableColumn nameColumn = new TableColumn(tagetTbl, SWT.CENTER);
nameColumn.setText(DIAG_NAME);
}
use of org.eclipse.swt.widgets.TableColumn in project cubrid-manager by CUBRID.
the class ChartCompositePart method createSeriesTable.
/**
* Create basic info table
*
* @param parent the parent composite
*
*/
private void createSeriesTable(Composite parent) {
final Composite comp = new Composite(parent, SWT.NONE);
GridData gdBasic = new GridData(SWT.FILL, SWT.NONE, false, false);
comp.setLayoutData(gdBasic);
GridLayout layout = new GridLayout();
layout.verticalSpacing = 0;
layout.horizontalSpacing = 0;
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginTop = 0;
layout.marginBottom = 0;
comp.setLayout(layout);
final Label label = new Label(comp, SWT.CENTER);
label.setText(Messages.tblSeriesTtl);
seriesTableViewer = new TableViewer(comp, SWT.NO_SCROLL | SWT.BORDER);
Table seriesTable = seriesTableViewer.getTable();
seriesTable.setHeaderVisible(true);
seriesTable.setLinesVisible(true);
GridData tblSeries = new GridData(SWT.FILL, SWT.TOP, true, false);
tblSeries.heightHint = CommonUITool.getHeightHintOfTable(seriesTable);
seriesTable.setLayoutData(tblSeries);
TableLayout seriesLayout = new TableLayout();
setSeriesTableLayout(seriesLayout);
seriesTable.setLayout(seriesLayout);
TableColumn tblColumn = new TableColumn(seriesTable, SWT.CENTER);
tblColumn.setText("");
tblColumn.setResizable(false);
for (Map.Entry<String, ShowSetting> entry : settingMap.entrySet()) {
tblColumn = new TableColumn(seriesTable, SWT.CENTER);
tblColumn.setText(entry.getKey());
tblColumn.setToolTipText(entry.getKey());
tblColumn.setResizable(false);
}
List<String[]> chartTblLst = new ArrayList<String[]>();
String[] arrays = valueMap.values().toArray(new String[valueMap.size()]);
String[] arrays2 = new String[arrays.length + 1];
arrays2[0] = "";
System.arraycopy(arrays, 0, arrays2, 1, arrays.length);
chartTblLst.add(arrays2);
ChartTableContentProvider chartTableContentProvider = new ChartTableContentProvider();
seriesTableViewer.setContentProvider(chartTableContentProvider);
seriesTableViewer.setLabelProvider(new ChartTableLabelProvider());
seriesTableViewer.setInput(chartTblLst);
int index = 0;
for (Map.Entry<String, ShowSetting> entry : settingMap.entrySet()) {
org.eclipse.swt.graphics.Color color = new org.eclipse.swt.graphics.Color(comp.getDisplay(), entry.getValue().getSeriesRgb());
seriesTableViewer.getTable().getItem(0).setBackground(index + 1, color);
index++;
}
seriesTable.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent event) {
updateTableLayout();
}
});
}
use of org.eclipse.swt.widgets.TableColumn in project sling by apache.
the class ArchetypeParametersWizardPage method createControl.
/**
* @see IDialogPage#createControl(Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
GridLayout layout = new GridLayout();
container.setLayout(layout);
layout.numColumns = 2;
layout.verticalSpacing = 9;
Label label = new Label(container, SWT.NULL);
label.setText("&Group Id:");
groupId = new Text(container, SWT.BORDER | SWT.SINGLE);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
groupId.setLayoutData(gd);
groupId.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
if (!javaPackageModified) {
if (artifactId.getText().length() == 0) {
javaPackage.setText(getDefaultJavaPackage(groupId.getText(), ""));
} else {
javaPackage.setText(getDefaultJavaPackage(groupId.getText(), artifactId.getText()));
}
}
}
});
label = new Label(container, SWT.NULL);
label.setText("&Artifact Id:");
artifactId = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
artifactId.setLayoutData(gd);
artifactId.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
if (javaPackageModified) {
return;
}
if (groupId.getText().length() == 0) {
javaPackage.setText(getDefaultJavaPackage("", artifactId.getText()));
} else {
javaPackage.setText(getDefaultJavaPackage(groupId.getText(), artifactId.getText()));
}
}
});
label = new Label(container, SWT.NULL);
label.setText("&Version:");
version = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
version.setLayoutData(gd);
version.setText("0.0.1-SNAPSHOT");
version.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
label = new Label(container, SWT.NULL);
label.setText("&Package:");
javaPackage = new Text(container, SWT.BORDER | SWT.SINGLE);
gd = new GridData(GridData.FILL_HORIZONTAL);
javaPackage.setLayoutData(gd);
javaPackageModified = false;
javaPackage.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
javaPackageModified = true;
}
});
javaPackage.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
dialogChanged();
}
});
label = new Label(container, SWT.NULL);
gd = new GridData(SWT.LEFT, SWT.TOP, false, false);
label.setLayoutData(gd);
label.setText("&Parameters:");
propertiesViewer = new TableViewer(container, SWT.BORDER | SWT.FULL_SELECTION);
propertiesTable = propertiesViewer.getTable();
propertiesTable.setLinesVisible(true);
propertiesTable.setHeaderVisible(true);
propertiesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
CellNavigationStrategy strategy = new CellNavigationStrategy();
TableViewerFocusCellManager focusCellMgr = new TableViewerFocusCellManager(propertiesViewer, new FocusCellOwnerDrawHighlighter(propertiesViewer), strategy);
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(propertiesViewer) {
@Override
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR) || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
}
};
int features = ColumnViewerEditor.TABBING_HORIZONTAL | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION | ColumnViewerEditor.KEEP_EDITOR_ON_DOUBLE_CLICK;
TableViewerEditor.create(propertiesViewer, focusCellMgr, actSupport, features);
TableColumn propertiesTableNameColumn = new TableColumn(propertiesTable, SWT.NONE);
propertiesTableNameColumn.setWidth(130);
propertiesTableNameColumn.setText("Name");
TableColumn propertiesTableValueColumn = new TableColumn(propertiesTable, SWT.NONE);
propertiesTableValueColumn.setWidth(230);
propertiesTableValueColumn.setText("Value");
propertiesViewer.setColumnProperties(new String[] { KEY_PROPERTY, VALUE_PROPERTY });
propertiesViewer.setCellEditors(new CellEditor[] { new TextCellEditor(propertiesTable, SWT.NONE), new TextCellEditor(propertiesTable, SWT.NONE) });
propertiesViewer.setCellModifier(new ICellModifier() {
public boolean canModify(Object element, String property) {
return true;
}
public void modify(Object element, String property, Object value) {
if (element instanceof TableItem) {
((TableItem) element).setText(getTextIndex(property), String.valueOf(value));
dialogChanged();
}
}
public Object getValue(Object element, String property) {
if (element instanceof TableItem) {
return ((TableItem) element).getText(getTextIndex(property));
}
return null;
}
});
initialize();
setPageComplete(false);
setControl(container);
}
use of org.eclipse.swt.widgets.TableColumn in project bndtools by bndtools.
the class ImportBndWorkspaceWizardPageOne method updateWorkspaceSelection.
/**
* Takes the selected/typed folder from the the {@link #txtFolder} and tries to obtain a valid Bnd Workspace. In any
* case, the {@link #tableViewer} is updated.
*
* @return true, when a Bnd Workspace was selected and properly initialized
*/
private boolean updateWorkspaceSelection() {
final String selectedFolder = txtFolder.getText();
boolean result = false;
// check if folder containing a cnf-folder for Bnd was selected
if (null != selectedFolder && selectedFolder.trim().length() > 0) {
File chosenDirectory = new File(txtFolder.getText());
if (chosenDirectory.exists()) {
final Workspace bndWorkspace;
try {
bndWorkspace = Workspace.getWorkspace(chosenDirectory);
setErrorMessage(null);
txtFolderErrorDecorator.hide();
List<Object> tableEntries = new ArrayList<Object>(bndWorkspace.getAllProjects());
tableEntries.add(bndWorkspace.getBuildDir());
tableViewer.setInput(tableEntries);
result = true;
} catch (Exception e) {
// not a valid Bnd Workspace folder
setErrorMessage(e.getMessage());
txtFolderErrorDecorator.show();
}
} else {
// handle non-existing folders
setErrorMessage("No Workspace found from: " + selectedFolder);
txtFolderErrorDecorator.show();
}
}
if (!result) {
tableViewer.setInput(Collections.emptyList());
}
for (TableColumn col : tableViewer.getTable().getColumns()) {
// make sure TableViewerColumn has enough width to display new selection
col.pack();
}
tableViewer.refresh();
return result;
}
Aggregations