use of org.eclipse.swt.widgets.Table in project cogtool by cogtool.
the class DictionaryEditorUI method selectAll.
public void selectAll() {
Table dictTable = view.getDictTable();
int size = dictTable.getItemCount();
// Don't select the pending entry row
dictTable.setSelection(0, size - 2);
}
use of org.eclipse.swt.widgets.Table in project cogtool by cogtool.
the class DictionaryEditorUI method setViewEnabledState.
protected void setViewEnabledState(Boolean context) {
try {
Table dictTable = view.getDictTable();
int selectionCount = dictTable.getSelectionCount();
boolean pendingSelected = dictTable.isSelected(dictTable.getItemCount() - 1);
boolean enabled = !pendingSelected && (selectionCount >= 1);
setEnabled(CogToolLID.Delete, context, enabled);
enabled = selectionCount == 1;
setEnabled(DictionaryEditorLID.SetSimilarity, context, enabled);
setEnabled(DictionaryEditorLID.SetGoalString, context, enabled);
setEnabled(DictionaryEditorLID.SetSearchString, context, enabled);
} catch (SWTException e) {
// ignore
}
}
use of org.eclipse.swt.widgets.Table in project otertool by wuntee.
the class LoadApkFromDeviceDialog method createContents.
/**
* Create contents of the dialog.
*/
private void createContents() {
shlSelectApk = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.RESIZE);
shlSelectApk.setSize(592, 486);
shlSelectApk.setText("Select APK");
shlSelectApk.setLayout(new GridLayout(1, false));
table = new Table(shlSelectApk, SWT.BORDER | SWT.FULL_SELECTION);
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent arg0) {
result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
shlSelectApk.close();
}
});
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
table.setBounds(0, 0, 3, 19);
table.setHeaderVisible(true);
table.setLinesVisible(true);
final TableColumn tblclmnApk = new TableColumn(table, SWT.NONE);
tblclmnApk.setWidth(240);
tblclmnApk.setText("APK");
final TableColumn tblclmnPackage = new TableColumn(table, SWT.NONE);
tblclmnPackage.setWidth(338);
tblclmnPackage.setText("Package");
final String[] keys = { PACKAGE_BEAN };
GuiWorkshop.addColumnSorter(table, tblclmnApk, 0, keys);
GuiWorkshop.addColumnSorter(table, tblclmnPackage, 1, keys);
Composite composite = new Composite(shlSelectApk, SWT.NONE);
composite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
composite.setBounds(0, 0, 64, 64);
GridLayout gl_composite = new GridLayout(2, false);
gl_composite.verticalSpacing = 0;
gl_composite.marginWidth = 0;
gl_composite.marginHeight = 0;
gl_composite.horizontalSpacing = 0;
composite.setLayout(gl_composite);
Button btnLoad = new Button(composite, SWT.NONE);
btnLoad.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
if (table.getSelection().length == 0) {
GuiWorkshop.messageError(shlSelectApk, "Please Select an APK to load.");
} else {
result = (PackageBean) table.getSelection()[0].getData(PACKAGE_BEAN);
shlSelectApk.close();
}
}
});
btnLoad.setText("Load");
Button btnCancel = new Button(composite, SWT.NONE);
btnCancel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
result = null;
shlSelectApk.close();
}
});
btnCancel.setText("Cancel");
}
use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class MultiSchemasShadowProcessPreview method newTablePreview.
@Override
public void newTablePreview() {
table = new Table(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
}
use of org.eclipse.swt.widgets.Table in project tdi-studio-se by Talend.
the class HL7OutputUI method addSchemaViewer.
private void addSchemaViewer(final Composite mainComposite, final int width, final int height) {
// Group Schema Viewer
final Group group = Form.createGroup(mainComposite, 1, "Linker Source", height);
// add by wzhang. add a combo for tFileOutputMSXML.
createCombo(group);
schemaViewer = new TableViewer(group);
// schemaViewer.set
// schemaViewer.getTable().setBackground(schemaViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_WHITE));
HL7OutputTableViewerProvider provider = new HL7OutputTableViewerProvider();
schemaViewer.setContentProvider(provider);
schemaViewer.setLabelProvider(provider);
GridData data2 = new GridData(GridData.FILL_BOTH);
Table table = schemaViewer.getTable();
// see bug 7087
if (canModify || isRespo) {
table.setEnabled(false);
}
// table.setLinesVisible(true);
table.setHeaderVisible(true);
TableColumn column1 = new TableColumn(table, SWT.LEFT);
column1.setText("Schema List");
column1.setWidth(100);
table.setLayoutData(data2);
}
Aggregations