Search in sources :

Example 1 with AbstractNodeWithDatabaseObjectReference

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;
}
Also used : IsUsedByNode(com.twinsoft.convertigo.eclipse.views.references.model.IsUsedByNode) RequiresNode(com.twinsoft.convertigo.eclipse.views.references.model.RequiresNode) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) InformationNode(com.twinsoft.convertigo.eclipse.views.references.model.InformationNode) AbstractNodeWithDatabaseObjectReference(com.twinsoft.convertigo.eclipse.views.references.model.AbstractNodeWithDatabaseObjectReference) Image(org.eclipse.swt.graphics.Image)

Example 2 with AbstractNodeWithDatabaseObjectReference

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.");
                }
            }
        }
    }
}
Also used : ProjectExplorerView(com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) SequenceTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.SequenceTreeObject) UrlMappingOperationTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UrlMappingOperationTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) UnloadedProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject) TransactionTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TransactionTreeObject) StepTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StepTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) ConnectorTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ConnectorTreeObject) ScreenClassTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject) AbstractNodeWithDatabaseObjectReference(com.twinsoft.convertigo.eclipse.views.references.model.AbstractNodeWithDatabaseObjectReference)

Aggregations

DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)2 AbstractNodeWithDatabaseObjectReference (com.twinsoft.convertigo.eclipse.views.references.model.AbstractNodeWithDatabaseObjectReference)2 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)1 ConnectorTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ConnectorTreeObject)1 ProjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject)1 ScreenClassTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject)1 SequenceTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.SequenceTreeObject)1 StepTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.StepTreeObject)1 TransactionTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TransactionTreeObject)1 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)1 UnloadedProjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UnloadedProjectTreeObject)1 UrlMappingOperationTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.UrlMappingOperationTreeObject)1 InformationNode (com.twinsoft.convertigo.eclipse.views.references.model.InformationNode)1 IsUsedByNode (com.twinsoft.convertigo.eclipse.views.references.model.IsUsedByNode)1 RequiresNode (com.twinsoft.convertigo.eclipse.views.references.model.RequiresNode)1 Image (org.eclipse.swt.graphics.Image)1