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

« back to all changes in this revision

Viewing changes to systemtap/org.eclipse.linuxtools.callgraph.core/src/org/eclipse/linuxtools/internal/callgraph/core/SystemTapView.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:
17
17
import org.eclipse.jface.action.IToolBarManager;
18
18
import org.eclipse.jface.action.MenuManager;
19
19
import org.eclipse.jface.dialogs.MessageDialog;
 
20
import org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory;
20
21
import org.eclipse.swt.SWT;
21
22
import org.eclipse.swt.custom.StyledText;
22
23
import org.eclipse.swt.graphics.Font;
31
32
import org.eclipse.ui.actions.ActionFactory;
32
33
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
33
34
import org.eclipse.ui.part.ViewPart;
 
35
import org.eclipse.ui.plugin.AbstractUIPlugin;
34
36
import org.eclipse.ui.progress.UIJob;
35
37
 
36
38
public abstract class SystemTapView extends ViewPart {
131
133
            return Status.OK_STATUS;
132
134
        }
133
135
 
134
 
    };
 
136
    }
135
137
 
136
138
    /**
137
139
     * Method for fetching a parser object. This method should return
230
232
   
231
233
    public void createHelpActions() {
232
234
        help_version = new Action(Messages.getString("SystemTapView.Version")) { //$NON-NLS-1$
233
 
            public void run() {
234
 
                Runtime rt = Runtime.getRuntime();
 
235
            @Override
 
236
                        public void run() {
235
237
                try {
236
 
                    Process pr = rt.exec("stap -V"); //$NON-NLS-1$
 
238
                        Process pr = RuntimeProcessFactory.getFactory().exec("stap -V", null);
237
239
                    BufferedReader buf = new BufferedReader(
238
240
                            new InputStreamReader(pr.getErrorStream()));
239
241
                    String line = ""; //$NON-NLS-1$
240
242
                    String message = ""; //$NON-NLS-1$
241
243
 
242
244
                    while ((line = buf.readLine()) != null) {
243
 
                        message += line + NEW_LINE; //$NON-NLS-1$
 
245
                        message += line + NEW_LINE;
244
246
                    }
245
247
 
246
248
                    try {
261
263
        };
262
264
       
263
265
        help_about = new Action(Messages.getString("SystemTapView.AboutMenu")) { //$NON-NLS-1$
264
 
            public void run() {
 
266
            @Override
 
267
                        public void run() {
265
268
                Display disp = Display.getCurrent();
266
269
                if (disp == null){
267
270
                    disp = Display.getDefault();
334
337
    protected void createSaveAction() {
335
338
        //Save callgraph.out
336
339
        save_file = new Action(Messages.getString("SystemTapView.SaveMenu")){ //$NON-NLS-1$
337
 
            public void run(){
 
340
            @Override
 
341
                        public void run(){
338
342
                Shell sh = new Shell();
339
343
                FileDialog dialog = new FileDialog(sh, SWT.SAVE);
340
344
                String filePath = dialog.open();
350
354
    protected void addKillButton() {
351
355
        IToolBarManager mgr = getViewSite().getActionBars().getToolBarManager();
352
356
        kill = new Action(Messages.getString("SystemTapView.StopScript"), //$NON-NLS-1$
353
 
                CallgraphCorePlugin.imageDescriptorFromPlugin(CallgraphCorePlugin.PLUGIN_ID, "icons/progress_stop.gif")) { //$NON-NLS-1$
354
 
            public void run() {
 
357
                AbstractUIPlugin.imageDescriptorFromPlugin(CallgraphCorePlugin.PLUGIN_ID, "icons/progress_stop.gif")) { //$NON-NLS-1$
 
358
            @Override
 
359
                        public void run() {
355
360
                getParser().cancelJob();
356
361
            }
357
362
        };