use of com.cubrid.common.ui.spi.model.BrokerConfig in project cubrid-manager by CUBRID.
the class UnifyHostConfigEditor method delBrokerConfColumn.
/**
* delBrokerConfColumn
*/
public void delBrokerConfColumn() {
editorInput.setBrokerConfPropertyCount(brokerConfTabTableViewer.getTable().getColumnCount());
LinkedHashMap<String, BrokerConfig> brokerConfMap = unifyHostConfigUtil.parseCommonTableValueToCubridBrokerConfig(cubridBrokerConfListData, editorInput.getBrokerConfPropertyCount());
Point pt = cubridBrokerTableClickPoint;
int selectIndex = brokerConfTabTableViewer.getTable().getSelectionIndex();
if (selectIndex < 0) {
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)) {
cubridBrokerConfListData.clear();
cubridBrokerConfListData.addAll(unifyHostConfigUtil.parseCubridBrokerConfigToCommonTableValue(cubridBrokerConfigDataMap));
String serverName = cubridBrokerConfListData.get(0).get(i + "");
String brokerName = cubridBrokerConfListData.get(1).get(i + "");
if (!CommonUITool.openConfirmBox(Messages.bind(Messages.unifyHostConfigEditorDelColumnConfirmMsg, brokerName, serverName))) {
return;
}
BrokerConfig cubridBrokerConfig = brokerConfMap.get(serverName);
cubridBrokerConfUtil.deleteBrokerPropertyByBrokerName(cubridBrokerConfig, brokerName);
cubridBrokerConfigDataMap.clear();
cubridBrokerConfigDataMap.putAll(brokerConfMap);
createBrokerConfTableData();
setDirty(true);
return;
}
}
}
Aggregations