use of com.twinsoft.convertigo.eclipse.views.references.model.AbstractNodeWithDatabaseObjectReference in project convertigo by convertigo.
the class ViewRefLabelProvider method getImage.
public Image getImage(Object element) {
String iconName = null;
Image image = null;
if (element instanceof AbstractNodeWithDatabaseObjectReference) {
AbstractNodeWithDatabaseObjectReference node = (AbstractNodeWithDatabaseObjectReference) element;
DatabaseObject databaseObject = node.getRefDatabaseObject();
/**
* treat case Entry handlers, Exit handlers etc... where dbo == null
* could be cleaner if having its own icon etc...
*/
if (databaseObject == null) {
if (node.getName().contains("entry"))
iconName = "/com/twinsoft/convertigo/beans/statements/images/handler_entry_16x16.png";
else if (node.getName().contains("exit"))
iconName = "/com/twinsoft/convertigo/beans/statements/images/handler_exit_16x16.png";
else
iconName = null;
} else
iconName = MySimpleBeanInfo.getIconName(databaseObject, BeanInfo.ICON_COLOR_16x16);
} else {
if (element instanceof InformationNode) {
iconName = "/com/twinsoft/convertigo/eclipse/views/references/images/information_color_16x16.png";
} else if (element instanceof IsUsedByNode) {
iconName = "/com/twinsoft/convertigo/eclipse/views/references/images/isusedby_16x16.png";
} else if (element instanceof RequiresNode) {
iconName = "/com/twinsoft/convertigo/eclipse/views/references/images/requires_16x16.png";
} else {
return null;
}
}
image = ViewImageProvider.getImageFromCache(iconName, element);
return image;
}
use of com.twinsoft.convertigo.eclipse.views.references.model.AbstractNodeWithDatabaseObjectReference in project convertigo by convertigo.
the class ReferencesView method handleSelectedObjectInRefView.
private void handleSelectedObjectInRefView(Object firstElement) {
if (firstElement != null) {
if (firstElement instanceof AbstractNodeWithDatabaseObjectReference) {
AbstractNodeWithDatabaseObjectReference abstractNode = (AbstractNodeWithDatabaseObjectReference) firstElement;
DatabaseObject selectedDatabaseObject = abstractNode.getRefDatabaseObject();
ProjectExplorerView projectExplorerView = ConvertigoPlugin.getDefault().getProjectExplorerView();
TreeObject selectedTreeObject = projectExplorerView.findTreeObjectByUserObject(selectedDatabaseObject);
if (selectedTreeObject != null) {
projectExplorerView.setSelectedTreeObject(selectedTreeObject);
if (selectedTreeObject instanceof UnloadedProjectTreeObject) {
ConvertigoPlugin.infoMessageBox("This project is closed. Please open the project first.");
}
}
}
}
}
Aggregations