use of com.cubrid.common.ui.spi.part.CubridViewPart in project cubrid-manager by CUBRID.
the class LayoutUtil method getViewPart.
/**
*
* Get the view part of this cubrid node and viewId
*
* @param cubridNode the ICubridNode object
* @param viewId the view id
* @return the IViewPart object
*/
public static IViewPart getViewPart(ICubridNode cubridNode, String viewId) {
IWorkbenchPage page = getActivePage();
if (page == null) {
return null;
}
IViewReference[] viewRefArr = page.getViewReferences();
if (viewRefArr == null || viewRefArr.length == 0) {
return null;
}
for (IViewReference viewRef : viewRefArr) {
IViewPart viewPart = viewRef.getView(false);
String id = viewRef.getId();
if (viewPart instanceof CubridViewPart) {
CubridViewPart cubridViewPart = (CubridViewPart) viewPart;
ICubridNode node = cubridViewPart.getCubridNode();
if (node != null && node.getId().equals(cubridNode.getId()) && viewId.equals(id)) {
return viewPart;
}
}
}
return null;
}
use of com.cubrid.common.ui.spi.part.CubridViewPart in project cubrid-manager by CUBRID.
the class LayoutUtil method getViewParts.
/**
*
* Get the view parts of this CUBRID node
*
* @param cubridNode the ICubridNode object
* @return List<IViewPart>
*/
public static List<IViewPart> getViewParts(ICubridNode cubridNode) {
List<IViewPart> viewPartList = new ArrayList<IViewPart>();
IWorkbenchPage page = getActivePage();
if (page == null) {
return viewPartList;
}
IViewReference[] viewRefArr = page.getViewReferences();
if (viewRefArr == null || viewRefArr.length == 0) {
return viewPartList;
}
for (IViewReference viewRef : viewRefArr) {
IViewPart viewPart = viewRef.getView(false);
if (viewPart instanceof CubridViewPart) {
CubridViewPart cubridViewPart = (CubridViewPart) viewPart;
ICubridNode node = cubridViewPart.getCubridNode();
if (node != null && node.getId().equals(cubridNode.getId())) {
viewPartList.add(viewPart);
}
}
}
return viewPartList;
}
Aggregations