~ubuntu-branches/ubuntu/wily/eclipse-linuxtools/wily

« back to all changes in this revision

Viewing changes to systemtap/org.eclipse.linuxtools.systemtap.graphing.ui/src/org/eclipse/linuxtools/systemtap/graphing/ui/wizards/graph/SelectGraphAndSeriesWizard.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam, Jakub Adam, tony mancill
  • Date: 2014-10-11 11:44:05 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20141011114405-yazjvxfzzhmi5sgj
Tags: 3.1.0-1
[ Jakub Adam ]
* New upstream release (Closes: #761524).
* Refreshed d/patches.
* Don't build removed feature org.eclipse.linuxtools.tools.launch
  - merged into org.eclipse.linuxtools.profiling.
* Use javac target 1.7.
* Build new feature org.eclipse.linuxtools.dataviewers.feature
  - required by Valgrind integration.
* Build-depend on eclipse-remote-services-api and eclipse-cdt-autotools.
* Bump Standards-Version to 3.9.6.
* Override incompatible-java-bytecode-format - linuxtools needs Java 7.
* Remove unused codeless-jar override.

[ tony mancill ]
* Tweak short package description to make lintian happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2006 IBM Corporation.
 
3
 * All rights reserved. This program and the accompanying materials
 
4
 * are made available under the terms of the Eclipse Public License v1.0
 
5
 * which accompanies this distribution, and is available at
 
6
 * http://www.eclipse.org/legal/epl-v10.html
 
7
 *
 
8
 * Contributors:
 
9
 *     IBM Corporation - Jeff Briggs, Henry Hughes, Ryan Morse
 
10
 *******************************************************************************/
 
11
 
 
12
package org.eclipse.linuxtools.systemtap.graphing.ui.wizards.graph;
 
13
 
 
14
import org.eclipse.jface.viewers.IStructuredSelection;
 
15
import org.eclipse.jface.wizard.Wizard;
 
16
import org.eclipse.linuxtools.internal.systemtap.graphing.ui.Localization;
 
17
import org.eclipse.linuxtools.systemtap.graphing.core.datasets.IDataSet;
 
18
import org.eclipse.linuxtools.systemtap.graphing.core.structures.GraphData;
 
19
import org.eclipse.ui.INewWizard;
 
20
import org.eclipse.ui.IWorkbench;
 
21
 
 
22
 
 
23
 
 
24
/**
 
25
 * @since 2.1
 
26
 */
 
27
public class SelectGraphAndSeriesWizard extends Wizard implements INewWizard {
 
28
    /**
 
29
     * The wizard for creating a new graph.
 
30
     * @param data An IDataSet that contains the names of all possible series values (columns).
 
31
     * @param gdata A GraphData instance that contains the saved settings of a previously-created graph.
 
32
     * If this wizard is for creating a new graph, set this parameter to null.
 
33
     */
 
34
    public SelectGraphAndSeriesWizard(IDataSet data, GraphData gdata) {
 
35
        model = new GraphModel(data);
 
36
        edit = (gdata != null);
 
37
        if (edit) {
 
38
            model.setGraph(gdata.graphID);
 
39
            model.setKey(gdata.key);
 
40
            model.setTitle(gdata.title);
 
41
            model.setXSeries(gdata.xSeries);
 
42
            model.setYSeries(gdata.ySeries);
 
43
        }
 
44
    }
 
45
 
 
46
    @Override
 
47
    public void init(IWorkbench workbench, IStructuredSelection selection) {
 
48
    }
 
49
 
 
50
    @Override
 
51
    public void addPages() {
 
52
        setWindowTitle(Localization.getString(!edit ? "SelectGraphAndSeriesWizard.CreateGraph" : "SelectGraphAndSeriesWizard.EditGraph"));  //$NON-NLS-1$//$NON-NLS-2$
 
53
        selectGraphandSeriesPage = new SelectGraphAndSeriesWizardPage();
 
54
        addPage(selectGraphandSeriesPage);
 
55
    }
 
56
 
 
57
    @Override
 
58
    public boolean canFinish() {
 
59
        if (selectGraphandSeriesPage.isPageComplete()) {
 
60
            return true;
 
61
        }
 
62
        return false;
 
63
    }
 
64
 
 
65
    @Override
 
66
    public boolean performCancel() {
 
67
        model.destroy();
 
68
        return true;
 
69
    }
 
70
 
 
71
    @Override
 
72
    public boolean performFinish() {
 
73
        return true;
 
74
    }
 
75
 
 
76
    public GraphData getGraphData() {
 
77
        return model.getGraphData();
 
78
    }
 
79
 
 
80
    public boolean isEditing() {
 
81
        return edit;
 
82
    }
 
83
 
 
84
    public SelectGraphAndSeriesWizardPage selectGraphandSeriesPage;
 
85
    public GraphModel model;
 
86
    private boolean edit;
 
87
}
 
 
b'\\ No newline at end of file'