~ubuntu-branches/ubuntu/trusty/eclipse-linuxtools/trusty

« back to all changes in this revision

Viewing changes to systemtap/org.eclipse.linuxtools.systemtap.ui.dashboard/src/org/eclipse/linuxtools/systemtap/ui/dashboard/views/DashboardGraphsBrowserView.java

  • Committer: Package Import Robot
  • Author(s): tony mancill
  • Date: 2013-05-13 21:43:22 UTC
  • mfrom: (1.2.1) (2.1.2 experimental)
  • Revision ID: package-import@ubuntu.com-20130513214322-6frgd9du1n0w2uo7
Tags: 1.2.1-1
* Team upload.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
public class DashboardGraphsBrowserView extends GraphsView {
42
42
        public DashboardGraphsBrowserView() {
43
43
                super();
44
 
                LogManager.logInfo("Initializing", this);
 
44
                LogManager.logInfo("Initializing", this); //$NON-NLS-1$
45
45
        }
46
46
        
47
47
        /**
58
58
                        viewer.setInput(new TreeNode("", false));
59
59
        }*/
60
60
        
 
61
        @Override
61
62
        protected void generateGraphsTree() {
62
 
                viewer.setInput(new TreeNode("root", "", false));
 
63
                viewer.setInput(new TreeNode("root", "", false)); //$NON-NLS-1$ //$NON-NLS-2$
63
64
        }
64
65
        
 
66
        @Override
65
67
        public void createPartControl(Composite parent) {
66
68
                super.createPartControl(parent);
67
69
                viewer.setLabelProvider(new ViewLabelProvider());
73
75
         * are actual modules.  It also sets up the layout for popup menu when users
74
76
         * right click on a module element.
75
77
         */
 
78
        @Override
76
79
        protected void makeActions() {
77
80
                //Gets items from plugin.xml
78
 
                MenuManager manager = new MenuManager("modulePopup");
 
81
                MenuManager manager = new MenuManager("modulePopup"); //$NON-NLS-1$
79
82
                Control control = this.viewer.getControl();
80
 
                manager.add(new Separator("file.ext"));
81
 
                manager.add(new Separator("build.ext"));
 
83
                manager.add(new Separator("file.ext")); //$NON-NLS-1$
 
84
                manager.add(new Separator("build.ext")); //$NON-NLS-1$
82
85
                manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
83
86
                Menu menu = manager.createContextMenu(control);
84
87
                control.setMenu(menu);
86
89
                super.makeActions();
87
90
        }
88
91
        
89
 
        @SuppressWarnings("unchecked")
90
92
        public void add(String display, ActiveModuleData data) {
91
93
                TreeNode root = (TreeNode)viewer.getInput();
92
94
                ActiveModuleTreeNode child = new ActiveModuleTreeNode(data, display, true);
115
117
         * This method removes all internal references. Nothing should be called/referenced after
116
118
         * this method is run.
117
119
         */
 
120
        @Override
118
121
        public void dispose() {
119
 
                LogManager.logInfo("disposing", this);
 
122
                LogManager.logInfo("disposing", this); //$NON-NLS-1$
120
123
                super.dispose();
121
124
                viewer=null;
122
125
        }
124
127
         * This class provides functionality for determining what image to 
125
128
         * display for each item in the tree.
126
129
         */
127
 
        private class ViewLabelProvider extends LabelProvider {
 
130
        private static class ViewLabelProvider extends LabelProvider {
 
131
                @Override
128
132
                public String getText(Object obj) {
129
133
                        return obj.toString();
130
134
                }
131
135
 
 
136
                @Override
132
137
                public Image getImage(Object obj) {
133
138
                        TreeNode treeObj = (TreeNode)obj;
134
139
                        Image img = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
135
140
                        
136
141
                        if(treeObj.getChildCount() > 0)
137
 
                                img = DashboardPlugin.getImageDescriptor("icons/misc/module_obj.gif").createImage();
 
142
                                img = DashboardPlugin.getImageDescriptor("icons/misc/module_obj.gif").createImage(); //$NON-NLS-1$
138
143
                        else if(treeObj instanceof GraphTreeNode){
139
144
                                if(null == ((DashboardGraphData)((GraphTreeNode)treeObj).getData()).adapter)
140
 
                                        img = DashboardPlugin.getImageDescriptor("icons/misc/graph_dis.gif").createImage();
 
145
                                        img = DashboardPlugin.getImageDescriptor("icons/misc/graph_dis.gif").createImage(); //$NON-NLS-1$
141
146
                                else
142
 
                                        img = DashboardPlugin.getImageDescriptor("icons/misc/graph_act.gif").createImage();
 
147
                                        img = DashboardPlugin.getImageDescriptor("icons/misc/graph_act.gif").createImage(); //$NON-NLS-1$
143
148
                        }
144
149
 
145
150
                        return img;
146
151
                }
147
152
        }       
148
 
        public static final String ID = "org.eclipse.linuxtools.systemtap.ui.dashboard.views.DashboardGraphsBrowserView";
 
153
        public static final String ID = "org.eclipse.linuxtools.systemtap.ui.dashboard.views.DashboardGraphsBrowserView"; //$NON-NLS-1$
149
154
        
150
155
}
151
156