use of com.cubrid.cubridmanager.ui.mondashboard.editor.BrokerDashboardViewPart in project cubrid-manager by CUBRID.
the class BrokerDataProvider method setDefaultValue.
/**
*
* Set default value
*
*/
private void setDefaultValue() {
isExecGetBrokerTask = false;
errorMsg = "";
if (brokerNodeList == null || brokerNodeList.isEmpty()) {
return;
}
BrokerNode brokerNode = null;
for (BrokerNode node : brokerNodeList) {
if (node.getParent().isConnected()) {
brokerNode = node;
break;
}
}
if (brokerNode == null) {
return;
}
HostNode hostNode = brokerNode.getParent();
if (hostNode != null && hostNode.isConnected()) {
List<DataUpdateListener> listenerList = generator.getListeners();
for (DataUpdateListener listener : listenerList) {
if (listener instanceof BrokerMonitorPartHelper || listener instanceof BrokerDashboardViewPart) {
isExecGetBrokerTask = true;
break;
}
}
serverInfo = hostNode.getServerInfo();
}
StringBuffer strBuff = new StringBuffer();
for (BrokerNode node : brokerNodeList) {
strBuff.append(node.getBrokerName());
strBuff.append(",");
}
strBuff = strBuff.deleteCharAt(strBuff.length() - 1);
allBrokersStr = strBuff.toString();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.BrokerDashboardViewPart in project cubrid-manager by CUBRID.
the class BrokerMonitorPart method performRequest.
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#performRequest(org.eclipse.gef.Request)
* @param req Request
*/
public void performRequest(Request req) {
if (req.getType() == RequestConstants.REQ_OPEN) {
BrokerNode bn = (BrokerNode) getModel();
String brokerName = bn.getBrokerName();
HostNode hn = bn.getParent();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
IWorkbenchPage page = window.getActivePage();
if (page == null) {
return;
}
String secondaryId = new StringBuffer(brokerName + "@" + hn.getUserName()).append("&").append(hn.getIp()).append("&").append(hn.getPort()).toString();
IViewReference viewReference = page.findViewReference(BrokerDashboardViewPart.ID, secondaryId);
if (viewReference == null) {
try {
IViewPart viewPart = page.showView(BrokerDashboardViewPart.ID, secondaryId, IWorkbenchPage.VIEW_ACTIVATE);
((BrokerDashboardViewPart) viewPart).init((BrokerNode) getModel());
} catch (PartInitException ex) {
viewReference = null;
}
} else {
IViewPart viewPart = viewReference.getView(false);
window.getActivePage().bringToTop(viewPart);
((BrokerDashboardViewPart) viewPart).init((BrokerNode) getModel());
}
}
}
Aggregations