use of com.cubrid.common.ui.common.dialog.CubridBrokerConfEditAnnotationDialog in project cubrid-manager by CUBRID.
the class UnifyHostConfigEditor method registerCubridCMConfTableContextMenu.
/**
* register CubridCMConfTable context menu
*/
private void registerCubridCMConfTableContextMenu() {
cubridCMConfTabTableViewer.getTable().addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
ActionManager.getInstance().changeFocusProvider(cubridCMConfTabTableViewer.getTable());
}
});
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
Menu contextMenu = menuManager.createContextMenu(cubridCMConfTabTableViewer.getTable());
cubridCMConfTabTableViewer.getTable().setMenu(contextMenu);
Menu menu = new Menu(this.getSite().getShell(), SWT.POP_UP);
final MenuItem itemEditAnnotation = new MenuItem(menu, SWT.PUSH);
itemEditAnnotation.setText(Messages.confEditorTableMenuEditAnnotation);
itemEditAnnotation.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("all")
public void widgetSelected(SelectionEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridCMConfTableClickPoint;
int selectIndex = cubridCMConfTabTableViewer.getTable().getSelectionIndex();
final TableItem item = cubridCMConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < cubridCMConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
CommonUITool.openErrorBox(getSite().getShell(), Messages.annotationDialogOpenErrorMsg);
return;
}
IStructuredSelection selection = (IStructuredSelection) cubridCMConfTabTableViewer.getSelection();
HashMap<String, String> valueMap = (HashMap<String, String>) selection.getFirstElement();
String serverName = cubridConfCMConfigListData.get(0).get(i + "");
String parentPropertyKey = valueMap.get("0");
String parentKey = " ";
Map<String, String> cubridMap = cubridConfCMConfigListData.get(1);
String cubridName = "";
if (cubridMap != null) {
cubridName = cubridMap.get(i + "");
}
if (selectIndex == 0) {
parentKey += serverName;
} else {
if (selectIndex == 1) {
parentKey += serverName + "->" + cubridName;
} else {
parentKey += serverName + "->" + cubridName + "->" + parentPropertyKey;
}
}
String annotationKey = Integer.toString(i) + BrokerConfPersistUtil.ANNOTATION;
CubridBrokerConfEditAnnotationDialog dialog = new CubridBrokerConfEditAnnotationDialog(getSite().getShell(), parentKey, annotationKey, valueMap);
if (IDialogConstants.OK_ID == dialog.open()) {
setDirty(true);
}
}
}
}
});
menu.addMenuListener(new MenuAdapter() {
public void menuShown(MenuEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridCMConfTableClickPoint;
// click timing
if (System.currentTimeMillis() - cubridCMConfTableClickPointTiming > 300) {
itemEditAnnotation.setEnabled(false);
return;
}
int selectIndex = cubridCMConfTabTableViewer.getTable().getSelectionIndex();
if (selectIndex == -1) {
itemEditAnnotation.setEnabled(false);
return;
}
if (selectIndex == 0) {
itemEditAnnotation.setEnabled(false);
return;
}
final TableItem item = cubridCMConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < cubridCMConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
itemEditAnnotation.setEnabled(false);
} else {
itemEditAnnotation.setEnabled(true);
}
}
}
}
});
cubridCMConfTabTableViewer.getTable().setMenu(menu);
}
use of com.cubrid.common.ui.common.dialog.CubridBrokerConfEditAnnotationDialog in project cubrid-manager by CUBRID.
the class BrokerConfigEditComposite method registerContextMenu.
/**
* Register context menu
*/
private void registerContextMenu() {
final Table confTable = confTableViewer.getTable();
confTable.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
ActionManager.getInstance().changeFocusProvider(confTable);
}
});
final MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
final Menu contextMenu = menuManager.createContextMenu(confTable);
confTable.setMenu(contextMenu);
final Menu menu = new Menu(editorPart.getSite().getShell(), SWT.POP_UP);
final MenuItem itemEditAnnotation = new MenuItem(menu, SWT.PUSH);
itemEditAnnotation.setText(Messages.cubridBrokerConfEditorTableMenuEditAnnotation);
itemEditAnnotation.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("all")
public void widgetSelected(SelectionEvent event) {
// It seems like MenuEvent can't get the mouse click Point
// so use the point which table MouseDown event marked
final Point pt = clickPoint;
int selectIndex = confTable.getSelectionIndex();
if (selectIndex < 0) {
return;
}
final TableItem item = confTable.getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0, len = confTable.getColumnCount(); i < len; i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
openErrorBox(editorPart.getSite().getShell(), Messages.cubridBrokerConfEditAnnotationDialogOpenErrorMsg);
return;
}
IStructuredSelection selection = (IStructuredSelection) confTableViewer.getSelection();
HashMap<String, String> valueMap = (HashMap<String, String>) selection.getFirstElement();
String brokerName = confListData.get(0).get(String.valueOf(i));
String parentPropertyKey = valueMap.get("0");
String parentKey = " ";
if (selectIndex == 0) {
parentKey += brokerName;
} else {
parentKey += brokerName + "->" + parentPropertyKey;
}
String annotationKey = i + ANNOTATION;
CubridBrokerConfEditAnnotationDialog dialog = new CubridBrokerConfEditAnnotationDialog(editorPart.getSite().getShell(), parentKey, annotationKey, valueMap);
if (dialog.open() == OK_ID) {
editorPart.setDirty(true);
}
}
}
}
});
final MenuItem itemAddBrokerConf = new MenuItem(menu, SWT.PUSH);
itemAddBrokerConf.setText(Messages.cubridBrokerConfEditorAddBrokerConfItemLabel);
itemAddBrokerConf.setImage(CommonUIPlugin.getImage("icons/action/column_insert.png"));
itemAddBrokerConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
addBrokerConfColumn();
editorPart.setDirty(true);
}
});
final MenuItem itemDeleteBrokerConf = new MenuItem(menu, SWT.PUSH);
itemDeleteBrokerConf.setText(Messages.cubridBrokerConfEditorDeleteBrokerConfItemLabel);
itemDeleteBrokerConf.setImage(CommonUIPlugin.getImage("icons/action/column_delete.png"));
itemDeleteBrokerConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// It seems like MenuEvent can't get the mouse click Point
// so use the point which table MouseDown event marked
final Point pt = clickPoint;
final TableItem item = findSelectItem(confTable);
if (item == null) {
return;
}
int columnCount = confTable.getColumnCount();
for (int i = 0; i < columnCount; i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
Map<String, String> valueMap = confListData.get(0);
String confName = valueMap.get(String.valueOf(i));
String msg = Messages.bind(Messages.cubridBrokerConfEditorDeleteBrokerConfConfirm, confName);
if (!CommonUITool.openConfirmBox(msg)) {
return;
}
confTable.getColumn(i).dispose();
for (int j = 1; j < columnCount; j++) {
confTable.getColumn(j).setText(Messages.cubridBrokerConfEditorBrokerTitle + (j - 1));
}
// delete data from cubridBrokerConfig, so regenerate cubridBrokerConfListData from cubridBrokerConfig
editorPart.getBrokerConfPersistUtil().deleteBrokerPropertyByBrokerName(brokerConfig, confName);
confListData.clear();
confListData.addAll(editorPart.parseBrokerConfigToCommonTableValue(brokerConfig));
confTableViewer.refresh();
editorPart.setDirty(true);
return;
}
}
}
});
menu.addMenuListener(new MenuAdapter() {
public void menuShown(MenuEvent event) {
// It seems like MenuEvent can't get the mouse click Point
// so use the point which table MouseDown event marked
final Point pt = clickPoint;
// It will allow that the click timing is more than 300 msec.
if (System.currentTimeMillis() - clickPointTiming > 300) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
itemAddBrokerConf.setEnabled(false);
return;
}
int selectIndex = confTable.getSelectionIndex();
if (selectIndex < 0) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
itemAddBrokerConf.setEnabled(true);
return;
}
final TableItem item = confTable.getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0, len = confTable.getColumnCount(); i < len; i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
boolean enableToAccess = i > 0;
itemEditAnnotation.setEnabled(enableToAccess);
itemDeleteBrokerConf.setEnabled(enableToAccess);
}
}
itemAddBrokerConf.setEnabled(true);
}
});
confTable.setMenu(menu);
}
use of com.cubrid.common.ui.common.dialog.CubridBrokerConfEditAnnotationDialog in project cubrid-manager by CUBRID.
the class UnifyHostConfigEditor method registerCubridBrokerTableContextMenu.
/**
* register CubridConfTable context menu
*/
private void registerCubridBrokerTableContextMenu() {
brokerConfTabTableViewer.getTable().addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
ActionManager.getInstance().changeFocusProvider(brokerConfTabTableViewer.getTable());
}
});
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
Menu contextMenu = menuManager.createContextMenu(brokerConfTabTableViewer.getTable());
brokerConfTabTableViewer.getTable().setMenu(contextMenu);
Menu menu = new Menu(this.getSite().getShell(), SWT.POP_UP);
final MenuItem itemEditAnnotation = new MenuItem(menu, SWT.PUSH);
itemEditAnnotation.setText(Messages.confEditorTableMenuEditAnnotation);
itemEditAnnotation.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("all")
public void widgetSelected(SelectionEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridBrokerTableClickPoint;
int selectIndex = brokerConfTabTableViewer.getTable().getSelectionIndex();
final TableItem item = brokerConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < brokerConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
CommonUITool.openErrorBox(getSite().getShell(), Messages.annotationDialogOpenErrorMsg);
return;
}
IStructuredSelection selection = (IStructuredSelection) brokerConfTabTableViewer.getSelection();
HashMap<String, String> valueMap = (HashMap<String, String>) selection.getFirstElement();
String serverName = cubridBrokerConfListData.get(0).get(i + "");
String parentPropertyKey = valueMap.get("0");
String parentKey = " ";
Map<String, String> brokerMap = cubridBrokerConfListData.get(1);
String brokerName = "";
if (brokerMap != null) {
brokerName = brokerMap.get(i + "");
}
if (selectIndex == 0) {
parentKey += serverName;
} else {
if (selectIndex == 1) {
parentKey += serverName + "->" + brokerName;
} else {
parentKey += serverName + "->" + brokerName + "->" + parentPropertyKey;
}
}
String annotationKey = Integer.toString(i) + BrokerConfPersistUtil.ANNOTATION;
CubridBrokerConfEditAnnotationDialog dialog = new CubridBrokerConfEditAnnotationDialog(getSite().getShell(), parentKey, annotationKey, valueMap);
if (IDialogConstants.OK_ID == dialog.open()) {
setDirty(true);
}
}
}
}
});
final MenuItem itemAddBrokerConf = new MenuItem(menu, SWT.PUSH);
itemAddBrokerConf.setText(com.cubrid.common.ui.common.Messages.cubridBrokerConfEditorAddBrokerConfItemLabel);
itemAddBrokerConf.setImage(CommonUIPlugin.getImage("icons/action/column_insert.png"));
itemAddBrokerConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
ProgressMonitorDialog progress = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
progress.setCancelable(true);
progress.run(true, true, new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) throws InvocationTargetException {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
// int horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y -
// brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
// = brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
monitor.beginTask(Messages.unifyHostConfigEditorAddColumnMsg, 1);
addBrokerConfColumn();
monitor.worked(1);
// horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y - horizontalSelectionInt;
// brokerConfTabTableViewer.getTable().getHorizontalBar().setSelection(horizontalSelectionInt + 160);
}
});
}
});
} catch (Exception e) {
LOGGER.error("", e);
}
setDirty(true);
}
});
final MenuItem itemDeleteBrokerConf = new MenuItem(menu, SWT.PUSH);
itemDeleteBrokerConf.setText(com.cubrid.common.ui.common.Messages.cubridBrokerConfEditorDeleteBrokerConfItemLabel);
itemDeleteBrokerConf.setImage(CommonUIPlugin.getImage("icons/action/column_delete.png"));
itemDeleteBrokerConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
ProgressMonitorDialog progress = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
progress.setCancelable(true);
progress.run(true, true, new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) throws InvocationTargetException {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
// int horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y -
// brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
// = brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
monitor.beginTask(Messages.unifyHostConfigEditorDelColumnMsg, 1);
delBrokerConfColumn();
monitor.worked(1);
// horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y - horizontalSelectionInt;
// brokerConfTabTableViewer.getTable().getHorizontalBar().setSelection(horizontalSelectionInt + 160);
}
});
}
});
} catch (Exception e) {
LOGGER.error("", e);
}
setDirty(true);
}
});
menu.addMenuListener(new MenuAdapter() {
public void menuShown(MenuEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridBrokerTableClickPoint;
// click timing
if (System.currentTimeMillis() - cubridBrokerTableClickPointTiming > 300) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
itemAddBrokerConf.setEnabled(false);
return;
}
int selectIndex = brokerConfTabTableViewer.getTable().getSelectionIndex();
if (selectIndex == -1) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
itemAddBrokerConf.setEnabled(false);
return;
}
if (selectIndex == 0) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
itemAddBrokerConf.setEnabled(true);
return;
}
final TableItem item = brokerConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < brokerConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
itemEditAnnotation.setEnabled(false);
itemDeleteBrokerConf.setEnabled(false);
} else {
itemEditAnnotation.setEnabled(true);
itemDeleteBrokerConf.setEnabled(true);
}
}
}
itemAddBrokerConf.setEnabled(true);
}
});
brokerConfTabTableViewer.getTable().setMenu(menu);
}
use of com.cubrid.common.ui.common.dialog.CubridBrokerConfEditAnnotationDialog in project cubrid-manager by CUBRID.
the class UnifyHostConfigEditor method registerCubridConfTableContextMenu.
/**
* register CubridConfTable context menu
*/
private void registerCubridConfTableContextMenu() {
cubridConfTabTableViewer.getTable().addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent event) {
ActionManager.getInstance().changeFocusProvider(cubridConfTabTableViewer.getTable());
}
});
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
Menu contextMenu = menuManager.createContextMenu(cubridConfTabTableViewer.getTable());
cubridConfTabTableViewer.getTable().setMenu(contextMenu);
Menu menu = new Menu(this.getSite().getShell(), SWT.POP_UP);
final MenuItem itemEditAnnotation = new MenuItem(menu, SWT.PUSH);
itemEditAnnotation.setText(Messages.confEditorTableMenuEditAnnotation);
itemEditAnnotation.addSelectionListener(new SelectionAdapter() {
@SuppressWarnings("all")
public void widgetSelected(SelectionEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridConfTableClickPoint;
int selectIndex = cubridConfTabTableViewer.getTable().getSelectionIndex();
final TableItem item = cubridConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < cubridConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
CommonUITool.openErrorBox(getSite().getShell(), Messages.annotationDialogOpenErrorMsg);
return;
}
IStructuredSelection selection = (IStructuredSelection) cubridConfTabTableViewer.getSelection();
HashMap<String, String> valueMap = (HashMap<String, String>) selection.getFirstElement();
String serverName = cubridConfConfigListData.get(0).get(i + "");
String parentPropertyKey = valueMap.get("0");
String parentKey = " ";
Map<String, String> cubridMap = cubridConfConfigListData.get(1);
String cubridName = "";
if (cubridMap != null) {
cubridName = cubridMap.get(i + "");
}
if (selectIndex == 0) {
parentKey += serverName;
} else {
if (selectIndex == 1) {
parentKey += serverName + "->" + cubridName;
} else {
parentKey += serverName + "->" + cubridName + "->" + parentPropertyKey;
}
}
String annotationKey = Integer.toString(i) + BrokerConfPersistUtil.ANNOTATION;
CubridBrokerConfEditAnnotationDialog dialog = new CubridBrokerConfEditAnnotationDialog(getSite().getShell(), parentKey, annotationKey, valueMap);
if (IDialogConstants.OK_ID == dialog.open()) {
setDirty(true);
}
}
}
}
});
final MenuItem itemAddCubridConf = new MenuItem(menu, SWT.PUSH);
itemAddCubridConf.setText(Messages.unifyHostConfigEditorAddCubridConfColumn);
itemAddCubridConf.setImage(CommonUIPlugin.getImage("icons/action/column_insert.png"));
itemAddCubridConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
ProgressMonitorDialog progress = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
progress.setCancelable(true);
progress.run(true, true, new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) throws InvocationTargetException {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
// int horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y -
// brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
// = brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
monitor.beginTask(Messages.unifyHostConfigEditorAddColumnMsg, 1);
addCubridConfColumn();
monitor.worked(1);
// horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y - horizontalSelectionInt;
// brokerConfTabTableViewer.getTable().getHorizontalBar().setSelection(horizontalSelectionInt + 160);
}
});
}
});
} catch (Exception e) {
LOGGER.error("", e);
}
setDirty(true);
}
});
final MenuItem itemDelCubridConf = new MenuItem(menu, SWT.PUSH);
itemDelCubridConf.setText(Messages.unifyHostConfigEditorDelCubridConfColumn);
itemDelCubridConf.setImage(CommonUIPlugin.getImage("icons/action/column_delete.png"));
itemDelCubridConf.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
try {
ProgressMonitorDialog progress = new ProgressMonitorDialog(Display.getCurrent().getActiveShell());
progress.setCancelable(true);
progress.run(true, true, new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) throws InvocationTargetException {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
// int horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y -
// brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
// = brokerConfTabTableViewer.getTable().getHorizontalBar().getSelection();
monitor.beginTask(Messages.unifyHostConfigEditorDelColumnMsg, 1);
delCubridConfColumn();
monitor.worked(1);
// horizontalSelectionInt = brokerConfTabTableViewer.getTable().getHorizontalBar().getSize().y - horizontalSelectionInt;
// brokerConfTabTableViewer.getTable().getHorizontalBar().setSelection(horizontalSelectionInt + 160);
}
});
}
});
} catch (Exception e) {
LOGGER.error("", e);
}
}
});
menu.addMenuListener(new MenuAdapter() {
public void menuShown(MenuEvent event) {
//seems like MenuEvent can't get the mouse click Point
//so use the point which table MouseDown event marked
Point pt = cubridConfTableClickPoint;
// click timing
if (System.currentTimeMillis() - cubridConfTableClickPointTiming > 300) {
itemEditAnnotation.setEnabled(false);
itemDelCubridConf.setEnabled(false);
itemAddCubridConf.setEnabled(false);
return;
}
int selectIndex = cubridConfTabTableViewer.getTable().getSelectionIndex();
if (selectIndex == -1) {
itemEditAnnotation.setEnabled(false);
itemDelCubridConf.setEnabled(false);
itemAddCubridConf.setEnabled(false);
return;
}
if (selectIndex == 0) {
itemEditAnnotation.setEnabled(false);
itemDelCubridConf.setEnabled(false);
itemAddCubridConf.setEnabled(true);
return;
}
final TableItem item = cubridConfTabTableViewer.getTable().getItem(selectIndex);
if (item == null) {
return;
}
for (int i = 0; i < cubridConfTabTableViewer.getTable().getColumnCount(); i++) {
Rectangle rect = item.getBounds(i);
if (rect.contains(pt)) {
if (i == 0) {
itemEditAnnotation.setEnabled(false);
itemDelCubridConf.setEnabled(false);
} else {
itemEditAnnotation.setEnabled(true);
itemDelCubridConf.setEnabled(true);
}
}
}
itemAddCubridConf.setEnabled(true);
}
});
cubridConfTabTableViewer.getTable().setMenu(menu);
}
Aggregations