提交 b7a21f04 编写于 作者: S serge-rider

List table editor fix

上级 f8605d46
......@@ -42,8 +42,6 @@ import java.util.List;
*/
public class StringEditorTable {
private static Button removeButton;
public static Table createEditableList(
@NotNull Composite parent,
@NotNull String name,
......@@ -103,21 +101,8 @@ public class StringEditorTable {
final Button addButton = new Button(buttonsGroup, SWT.PUSH);
addButton.setText(CoreMessages.dialog_filter_button_add);
addButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TableItem newItem = new TableItem(valueTable, SWT.LEFT);
if (icon != null) {
newItem.setImage(DBeaverIcons.getImage(icon));
}
valueTable.setSelection(newItem);
tableEditor.closeEditor();
tableEditor.showEditor(newItem);
removeButton.setEnabled(true);
}
});
removeButton = new Button(buttonsGroup, SWT.PUSH);
Button removeButton = new Button(buttonsGroup, SWT.PUSH);
removeButton.setText(CoreMessages.dialog_filter_button_remove);
removeButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
removeButton.addSelectionListener(new SelectionAdapter() {
......@@ -145,6 +130,20 @@ public class StringEditorTable {
}
});
addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TableItem newItem = new TableItem(valueTable, SWT.LEFT);
if (icon != null) {
newItem.setImage(DBeaverIcons.getImage(icon));
}
valueTable.setSelection(newItem);
tableEditor.closeEditor();
tableEditor.showEditor(newItem);
removeButton.setEnabled(true);
}
});
valueTable.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册