Java Code Examples for org.eclipse.swt.widgets.Table#addSelectionListener()
The following examples show how to use
org.eclipse.swt.widgets.Table#addSelectionListener() .
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: OrderableFieldDialogImpl.java From jenerate with Eclipse Public License 1.0 | 5 votes |
@Override public void create() { super.create(); Table fieldTable = fieldViewer.getTable(); fieldTable.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleTableSelectionChanged(); } }); }
Example 2
Source File: AbstractTableViewPart.java From tesb-studio-se with Apache License 2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") final Control createControl(Composite parent) { tableView = createTableView(parent, getLabelKey(), getTableModel()); final Table table = tableView.getTable(); table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TableItem[] item = table.getSelection(); U currentPortName = (U) item[0].getData(); itemSelected(currentPortName); } }); return table; }
Example 3
Source File: SearchDialog.java From ermasterr with Apache License 2.0 | 4 votes |
private void createResultGroup(final TabFolder tabFolder) { final TabItem tabItem = new TabItem(tabFolder, SWT.NONE); tabItem.setText(ResourceString.getResourceString("label.search.result")); final GridData gridData = new GridData(); gridData.grabExcessVerticalSpace = true; gridData.verticalAlignment = SWT.FILL; gridData.grabExcessHorizontalSpace = true; gridData.horizontalAlignment = SWT.FILL; resultTable = new Table(tabFolder, SWT.NONE | SWT.FULL_SELECTION | SWT.MULTI); resultTable.setHeaderVisible(true); resultTable.setLayoutData(gridData); resultTable.setLinesVisible(true); resultTable.addSelectionListener(new SelectionAdapter() { /** * {@inheritDoc} */ @Override public void widgetSelected(final SelectionEvent e) { final int index = resultTable.getSelectionIndex(); if (index == -1) { replaceButton.setEnabled(false); replaceCombo.setEnabled(false); } else { replaceButton.setEnabled(true); replaceCombo.setEnabled(true); final SearchResultRow searchResultRow = searchResult.getRows().get(index); final Object object = searchResultRow.getTargetNode(); if (object != null) { focus(object); } } } }); final TableColumn tableColumn0 = new TableColumn(resultTable, SWT.LEFT); tableColumn0.setWidth(250); tableColumn0.setText(ResourceString.getResourceString("label.search.result.table.path")); tableColumn0.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_PATH)); final TableColumn tableColumn1 = new TableColumn(resultTable, SWT.LEFT); tableColumn1.setWidth(100); tableColumn1.setText(ResourceString.getResourceString("label.search.result.table.type")); tableColumn1.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_TYPE)); final TableColumn tableColumn2 = new TableColumn(resultTable, SWT.LEFT); tableColumn2.setWidth(200); tableColumn2.setText(ResourceString.getResourceString("label.search.result.table.name")); tableColumn2.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_NAME)); final TableColumn tableColumn3 = new TableColumn(resultTable, SWT.LEFT); tableColumn3.setWidth(200); tableColumn3.setText(ResourceString.getResourceString("label.search.result.table.value")); tableColumn3.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_VALUE)); tabItem.setControl(resultTable); }
Example 4
Source File: GroupSelectionDialog.java From spotbugs with GNU Lesser General Public License v2.1 | 4 votes |
@Override protected Control createDialogArea(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); int columns = 2; composite.setLayout(new GridLayout(columns, false)); GridData layoutData = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_HORIZONTAL); layoutData.minimumHeight = 200; layoutData.minimumWidth = 250; layoutData.heightHint = 200; layoutData.widthHint = 250; composite.setLayoutData(layoutData); checkList = CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER | SWT.RESIZE | SWT.V_SCROLL | SWT.H_SCROLL); Table table = checkList.getTable(); table.setHeaderVisible(true); table.setLinesVisible(false); table.setLayoutData(new GridData(GridData.FILL_BOTH)); TableColumn nameColumn = new TableColumn(table, SWT.NONE); nameColumn.setText("Group Visibility / Sort Order"); nameColumn.setResizable(true); nameColumn.setWidth(170); checkList.setContentProvider(new ArrayContentProvider()); // ITableLabelProvider labelProvider= new SeparateTableLabelProvider(); // checkList.setLabelProvider(labelProvider); checkList.setInput(allowedGroups); checkList.setCheckedElements(preSelectedGroups.toArray()); checkList.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { boolean checked = event.getChecked(); GroupType element = (GroupType) event.getElement(); selectionMap.put(element, Boolean.valueOf(checked)); } }); table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleTableSelection(); } }); createButtonList(composite); return composite; }
Example 5
Source File: ItemMover.java From LogViewer with Eclipse Public License 2.0 | 4 votes |
public ItemMover(Table table, RuleStore store) { this.table = table; this.store = store; table.addSelectionListener(this); }
Example 6
Source File: CodeAssistAdvancedConfigurationBlock.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private void createSeparateViewer(Composite composite) { fSeparateViewer= CheckboxTableViewer.newCheckList(composite, SWT.SINGLE | SWT.BORDER); Table table= fSeparateViewer.getTable(); table.setHeaderVisible(false); table.setLinesVisible(false); table.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false, 1, 1)); TableColumn nameColumn= new TableColumn(table, SWT.NONE); nameColumn.setText(PreferencesMessages.CodeAssistAdvancedConfigurationBlock_separate_table_category_column_title); nameColumn.setResizable(false); fSeparateViewer.setContentProvider(new ArrayContentProvider()); ITableLabelProvider labelProvider= new SeparateTableLabelProvider(); fSeparateViewer.setLabelProvider(labelProvider); fSeparateViewer.setInput(fModel.elements); final int ICON_AND_CHECKBOX_WITH= 50; final int HEADER_MARGIN= 20; int minNameWidth= computeWidth(table, nameColumn.getText()) + HEADER_MARGIN; for (int i= 0; i < fModel.elements.size(); i++) { minNameWidth= Math.max(minNameWidth, computeWidth(table, labelProvider.getColumnText(fModel.elements.get(i), 0)) + ICON_AND_CHECKBOX_WITH); } nameColumn.setWidth(minNameWidth); fSeparateViewer.addCheckStateListener(new ICheckStateListener() { public void checkStateChanged(CheckStateChangedEvent event) { boolean checked= event.getChecked(); ModelElement element= (ModelElement) event.getElement(); element.setSeparateCommand(checked); } }); table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleTableSelection(); } }); }
Example 7
Source File: ReverseConversionWizardPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * 创建文件列表区域 * @param contents * ; */ private Composite createFilesGroup(Composite contents) { Composite filesComposite = new Composite(contents, SWT.NONE); filesComposite.setLayout(new GridLayout(1, false)); filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); tableData.heightHint = 100; filesTable.setLayoutData(tableData); filesTable.setLinesVisible(true); filesTable.setHeaderVisible(true); filesTable.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TableItem[] selected = filesTable.getSelection(); if (selected.length == 0) { return; } String strTgtEnc = ""; //$NON-NLS-1$ for (int i = 0; i < selected.length; i++) { String curTgtEnc = selected[i].getText(2); if (i == 0) { strTgtEnc = curTgtEnc; } else { if (!strTgtEnc.equals(curTgtEnc)) { strTgtEnc = ""; //$NON-NLS-1$ break; } } } if (!"".equals(strTgtEnc)) { //$NON-NLS-1$ tgtEncCombo.setText(strTgtEnc); } else { tgtEncCombo.deselectAll(); } } }); tableViewer = new TableViewer(filesTable); lineNumberColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); lineNumberColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.lineNumberColumn")); xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); xliffColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.xliffColumn")); //$NON-NLS-1$ tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); tgtEncColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.tgtEncColumn")); //$NON-NLS-1$ targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); targetColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.targetColumn")); //$NON-NLS-1$ IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] { "index","source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class), valueProperties); filesComposite.addPaintListener(new PaintListener() { public void paintControl(PaintEvent arg0) { int width = filesTable.getClientArea().width; lineNumberColumn.setWidth(width * 1 / 10); targetColumn.setWidth(width * 4 / 10); tgtEncColumn.setWidth(width * 1 / 10); xliffColumn.setWidth(width * 4 / 10); } }); return filesComposite; }
Example 8
Source File: ReverseConversionWizardPage.java From translationstudio8 with GNU General Public License v2.0 | 4 votes |
/** * 创建文件列表区域 * @param contents * ; */ private Composite createFilesGroup(Composite contents) { Composite filesComposite = new Composite(contents, SWT.NONE); filesComposite.setLayout(new GridLayout(1, false)); filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); tableData.heightHint = 100; filesTable.setLayoutData(tableData); filesTable.setLinesVisible(true); filesTable.setHeaderVisible(true); filesTable.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TableItem[] selected = filesTable.getSelection(); if (selected.length == 0) { return; } String strTgtEnc = ""; //$NON-NLS-1$ for (int i = 0; i < selected.length; i++) { String curTgtEnc = selected[i].getText(1); if (i == 0) { strTgtEnc = curTgtEnc; } else { if (!strTgtEnc.equals(curTgtEnc)) { strTgtEnc = ""; //$NON-NLS-1$ break; } } } if (!"".equals(strTgtEnc)) { //$NON-NLS-1$ tgtEncCombo.setText(strTgtEnc); } else { tgtEncCombo.deselectAll(); } } }); tableViewer = new TableViewer(filesTable); xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); xliffColumn.setText("XLIFF 文件"); //$NON-NLS-1$ tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); tgtEncColumn.setText("目标编码"); //$NON-NLS-1$ targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); targetColumn.setText("目标文件"); //$NON-NLS-1$ IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] { "source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class), valueProperties); filesComposite.addPaintListener(new PaintListener() { public void paintControl(PaintEvent arg0) { int width = filesTable.getClientArea().width; targetColumn.setWidth(width * 4 / 10); tgtEncColumn.setWidth(width * 2 / 10); xliffColumn.setWidth(width * 4 / 10); } }); return filesComposite; }
Example 9
Source File: ReverseConversionWizardPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * 创建文件列表区域 * @param contents * ; */ private Composite createFilesGroup(Composite contents) { Composite filesComposite = new Composite(contents, SWT.NONE); filesComposite.setLayout(new GridLayout(1, false)); filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); tableData.heightHint = 100; filesTable.setLayoutData(tableData); filesTable.setLinesVisible(true); filesTable.setHeaderVisible(true); filesTable.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TableItem[] selected = filesTable.getSelection(); if (selected.length == 0) { return; } String strTgtEnc = ""; //$NON-NLS-1$ for (int i = 0; i < selected.length; i++) { String curTgtEnc = selected[i].getText(2); if (i == 0) { strTgtEnc = curTgtEnc; } else { if (!strTgtEnc.equals(curTgtEnc)) { strTgtEnc = ""; //$NON-NLS-1$ break; } } } if (!"".equals(strTgtEnc)) { //$NON-NLS-1$ tgtEncCombo.setText(strTgtEnc); } else { tgtEncCombo.deselectAll(); } } }); tableViewer = new TableViewer(filesTable); lineNumberColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); lineNumberColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.lineNumberColumn")); xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); xliffColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.xliffColumn")); //$NON-NLS-1$ tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); tgtEncColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.tgtEncColumn")); //$NON-NLS-1$ targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); targetColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.targetColumn")); //$NON-NLS-1$ IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] { "index","source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class), valueProperties); filesComposite.addPaintListener(new PaintListener() { public void paintControl(PaintEvent arg0) { int width = filesTable.getClientArea().width; lineNumberColumn.setWidth(width * 1 / 10); targetColumn.setWidth(width * 4 / 10); tgtEncColumn.setWidth(width * 1 / 10); xliffColumn.setWidth(width * 4 / 10); } }); return filesComposite; }
Example 10
Source File: ReverseConversionWizardPage.java From tmxeditor8 with GNU General Public License v2.0 | 4 votes |
/** * 创建文件列表区域 * @param contents * ; */ private Composite createFilesGroup(Composite contents) { Composite filesComposite = new Composite(contents, SWT.NONE); filesComposite.setLayout(new GridLayout(1, false)); filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH)); filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION); GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH); tableData.heightHint = 100; filesTable.setLayoutData(tableData); filesTable.setLinesVisible(true); filesTable.setHeaderVisible(true); filesTable.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { TableItem[] selected = filesTable.getSelection(); if (selected.length == 0) { return; } String strTgtEnc = ""; //$NON-NLS-1$ for (int i = 0; i < selected.length; i++) { String curTgtEnc = selected[i].getText(1); if (i == 0) { strTgtEnc = curTgtEnc; } else { if (!strTgtEnc.equals(curTgtEnc)) { strTgtEnc = ""; //$NON-NLS-1$ break; } } } if (!"".equals(strTgtEnc)) { //$NON-NLS-1$ tgtEncCombo.setText(strTgtEnc); } else { tgtEncCombo.deselectAll(); } } }); tableViewer = new TableViewer(filesTable); xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); xliffColumn.setText("XLIFF 文件"); //$NON-NLS-1$ tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); tgtEncColumn.setText("目标编码"); //$NON-NLS-1$ targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn(); targetColumn.setText("目标文件"); //$NON-NLS-1$ IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] { "source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class), valueProperties); filesComposite.addPaintListener(new PaintListener() { public void paintControl(PaintEvent arg0) { int width = filesTable.getClientArea().width; targetColumn.setWidth(width * 4 / 10); tgtEncColumn.setWidth(width * 2 / 10); xliffColumn.setWidth(width * 4 / 10); } }); return filesComposite; }
Example 11
Source File: ExtendedPropertyEditorComposite.java From birt with Eclipse Public License 1.0 | 4 votes |
private void placeComponents( ) { GridLayout glContent = new GridLayout( ); glContent.horizontalSpacing = 5; glContent.verticalSpacing = 5; glContent.marginHeight = 7; glContent.marginWidth = 7; this.setLayout( glContent ); table = new Table( this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER ); GridData gdTable = new GridData( GridData.FILL_BOTH ); table.setLayoutData( gdTable ); table.setHeaderVisible( true ); table.setLinesVisible( true ); TableColumn tcKey = new TableColumn( table, SWT.CENTER ); tcKey.setWidth( 186 ); tcKey.setText( Messages.getString( "PropertyEditorDialog.Lbl.Key" ) ); //$NON-NLS-1$ TableColumn tcValue = new TableColumn( table, SWT.LEFT ); tcValue.setWidth( 186 ); tcValue.setText( Messages.getString( "PropertyEditorDialog.Lbl.Value" ) ); //$NON-NLS-1$ editorValue = new TableEditor( table ); editorValue.setColumn( 1 ); editorValue.grabHorizontal = true; editorValue.minimumWidth = 30; table.addSelectionListener( this ); // Layout for buttons panel GridLayout glButtons = new GridLayout( ); glButtons.numColumns = 3; glButtons.horizontalSpacing = 5; glButtons.verticalSpacing = 5; glButtons.marginWidth = 0; glButtons.marginHeight = 0; Composite cmpButtons = new Composite( this, SWT.NONE ); GridData gdCMPButtons = new GridData( GridData.FILL_HORIZONTAL ); cmpButtons.setLayoutData( gdCMPButtons ); cmpButtons.setLayout( glButtons ); txtNewKey = new Text( cmpButtons, SWT.SINGLE | SWT.BORDER ); GridData gdTXTNewKey = new GridData( GridData.FILL_HORIZONTAL ); gdTXTNewKey.grabExcessHorizontalSpace = true; txtNewKey.setLayoutData( gdTXTNewKey ); btnAdd = new Button( cmpButtons, SWT.PUSH ); GridData gdBTNAdd = new GridData( GridData.HORIZONTAL_ALIGN_END ); gdBTNAdd.grabExcessHorizontalSpace = false; btnAdd.setLayoutData( gdBTNAdd ); btnAdd.setText( Messages.getString( "PropertyEditorDialog.Lbl.Add" ) ); //$NON-NLS-1$ btnAdd.addSelectionListener( this ); btnRemove = new Button( cmpButtons, SWT.PUSH ); GridData gdBTNRemove = new GridData( GridData.HORIZONTAL_ALIGN_END ); gdBTNRemove.grabExcessHorizontalSpace = false; btnRemove.setLayoutData( gdBTNRemove ); btnRemove.setText( Messages.getString( "PropertyEditorDialog.Lbl.Remove" ) ); //$NON-NLS-1$ btnRemove.addSelectionListener( this ); populateTable( ); }
Example 12
Source File: DialogCriterionSelection.java From arx with Apache License 2.0 | 4 votes |
@Override protected Control createDialogArea(final Composite parent) { parent.setLayout(new GridLayout()); final Table table = SWTUtil.createTable(parent, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); table.setHeaderVisible(true); final GridData d = SWTUtil.createFillGridData(); d.heightHint = 100; table.setLayoutData(d); TableColumn column1 = new TableColumn(table, SWT.NONE); column1.setText(""); //$NON-NLS-1$ TableColumn column2 = new TableColumn(table, SWT.NONE); column2.setText(Resources.getMessage("CriterionSelectionDialog.2")); //$NON-NLS-1$ TableColumn column3 = new TableColumn(table, SWT.NONE); column3.setText(Resources.getMessage("CriterionSelectionDialog.3")); //$NON-NLS-1$ Image symbolL = controller.getResources().getManagedImage("symbol_l.png"); //$NON-NLS-1$ Image symbolT = controller.getResources().getManagedImage("symbol_t.png"); //$NON-NLS-1$ Image symbolD = controller.getResources().getManagedImage("symbol_d.png"); //$NON-NLS-1$ Image symbolB = controller.getResources().getManagedImage("symbol_b.png"); //$NON-NLS-1$ for (ModelExplicitCriterion c : elements) { TableItem item = new TableItem(table, SWT.NONE); item.setText(new String[] { "", c.toString(), c.getAttribute() }); //$NON-NLS-1$ if (c instanceof ModelLDiversityCriterion) { item.setImage(0, symbolL); } else if (c instanceof ModelTClosenessCriterion) { item.setImage(0, symbolT); } else if (c instanceof ModelDDisclosurePrivacyCriterion) { item.setImage(0, symbolD); } else if (c instanceof ModelBLikenessCriterion) { item.setImage(0, symbolB); } } table.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { if (table.getSelectionIndex() != -1) { selection = elements.get(table.getSelectionIndex()); ok.setEnabled(true); } else { selection = null; ok.setEnabled(false); } } }); column1.pack(); column2.pack(); column3.pack(); return parent; }