Skip to content
Snippets Groups Projects
Commit 0999fae1 authored by Erlend Stav's avatar Erlend Stav
Browse files

Updated dashboard to support separate application and ontology processes

parent dcccd0fd
No related branches found
No related tags found
No related merge requests found
package org.universaal.tools.dashboard.views;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.ui.part.ViewPart;
import org.eclipse.wb.swt.ResourceManager;
import org.eclipse.wb.swt.SWTResourceManager;
import org.universaal.tools.dashboard.buttonlisteners.CommandCallingListener;
import org.universaal.tools.dashboard.buttonlisteners.TemporaryListener;
public class ApplicationView extends Composite {
private Button btnCreate;
private Button btnImportProject;
private Button btnImportExample;
private Button btnTransform;
private Button btnCreateClass;
private Button btnImportClass;
private Button btnBuild;
private Button btnTestConformance;
private Button btnRun;
private Button btnDebug;
private Button btnCombine;
private Button btnPublishToUStore;
private Button btnPublishOpenSource;
private Button btnCreateAndEdit;
private Group grpConfiguration;
private Button btnExtractParameters;
/**
* Create the composite.
* @param parent
* @param style
*/
public ApplicationView(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout(7, false));
Group grpProject = new Group(this, SWT.NONE);
grpProject.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpProject.setBackground(SWTResourceManager.getColor(135, 206, 250));
grpProject.setLayout(new FillLayout(SWT.VERTICAL));
grpProject.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 2));
grpProject.setText("Project");
btnCreate = new Button(grpProject, SWT.NONE);
btnCreate.setText("Create");
btnImportProject = new Button(grpProject, SWT.NONE);
btnImportProject.setEnabled(false);
btnImportProject.setText("Import Project");
btnImportExample = new Button(grpProject, SWT.NONE);
btnImportExample.setText("Import Example");
Composite composite = new Composite(this, SWT.NONE);
RowLayout rl_composite = new RowLayout(SWT.VERTICAL);
rl_composite.center = true;
composite.setLayout(rl_composite);
composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 2));
Label lblAbc = new Label(composite, SWT.NONE);
lblAbc.setImage(ResourceManager.getPluginImage("org.universaal.tools.dashboard", "icons/go-next.png"));
btnTransform = new Button(composite, SWT.NONE);
btnTransform.setEnabled(false);
btnTransform.setText("Transform");
Group grpJavaClasses = new Group(this, SWT.NONE);
grpJavaClasses.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpJavaClasses.setBackground(SWTResourceManager.getColor(135, 206, 250));
grpJavaClasses.setLayout(new FillLayout(SWT.VERTICAL));
GridData gd_grpJavaClasses = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gd_grpJavaClasses.widthHint = 92;
grpJavaClasses.setLayoutData(gd_grpJavaClasses);
grpJavaClasses.setText("Java Classes");
btnCreateClass = new Button(grpJavaClasses, SWT.NONE);
btnCreateClass.setText("Create");
btnImportClass = new Button(grpJavaClasses, SWT.NONE);
btnImportClass.setEnabled(false);
btnImportClass.setText("Import");
Composite composite_1 = new Composite(this, SWT.NONE);
RowLayout rl_composite_1 = new RowLayout(SWT.VERTICAL);
rl_composite_1.center = true;
composite_1.setLayout(rl_composite_1);
composite_1.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 2));
Label label = new Label(composite_1, SWT.NONE);
label.setImage(ResourceManager.getPluginImage("org.universaal.tools.dashboard", "icons/go-next.png"));
btnBuild = new Button(composite_1, SWT.NONE);
btnBuild.setText("Build");
Group grpApplicationBinary = new Group(this, SWT.NONE);
grpApplicationBinary.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpApplicationBinary.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
grpApplicationBinary.setBackground(SWTResourceManager.getColor(135, 206, 250));
grpApplicationBinary.setText("Application Binary");
grpApplicationBinary.setLayout(new FillLayout(SWT.VERTICAL));
btnTestConformance = new Button(grpApplicationBinary, SWT.NONE);
btnTestConformance.setEnabled(false);
btnTestConformance.setText("Test Conformance");
btnRun = new Button(grpApplicationBinary, SWT.NONE);
btnRun.setText("Run");
btnDebug = new Button(grpApplicationBinary, SWT.NONE);
btnDebug.setText("Debug");
Composite composite_2 = new Composite(this, SWT.NONE);
RowLayout rl_composite_2 = new RowLayout(SWT.VERTICAL);
rl_composite_2.center = true;
composite_2.setLayout(rl_composite_2);
composite_2.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 2));
Label label_1 = new Label(composite_2, SWT.NONE);
label_1.setImage(ResourceManager.getPluginImage("org.universaal.tools.dashboard", "icons/go-next.png"));
btnCombine = new Button(composite_2, SWT.NONE);
btnCombine.setEnabled(false);
btnCombine.setText("Combine");
Group grpPublishableOntology = new Group(this, SWT.BORDER);
grpPublishableOntology.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpPublishableOntology.setBackground(SWTResourceManager.getColor(135, 206, 250));
grpPublishableOntology.setLayout(new FillLayout(SWT.VERTICAL));
grpPublishableOntology.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 2));
grpPublishableOntology.setText("Publishable Ontology");
btnPublishToUStore = new Button(grpPublishableOntology, SWT.NONE);
btnPublishToUStore.setText("Publish to uStore");
btnPublishOpenSource = new Button(grpPublishableOntology, SWT.NONE);
btnPublishOpenSource.setText("Publish Open Source");
grpConfiguration = new Group(this, SWT.NONE);
grpConfiguration.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpConfiguration.setBackground(SWTResourceManager.getColor(135, 206, 250));
grpConfiguration.setLayout(new FillLayout(SWT.HORIZONTAL));
grpConfiguration.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
grpConfiguration.setText("Configuration");
btnExtractParameters = new Button(grpConfiguration, SWT.NONE);
btnExtractParameters.setText("Extract parameters");
Group grpApplicationDescription = new Group(this, SWT.NONE);
grpApplicationDescription.setFont(SWTResourceManager.getFont("Lucida Grande", 11, SWT.BOLD));
grpApplicationDescription.setBackground(SWTResourceManager.getColor(135, 206, 250));
GridData gd_grpApplicationDescription = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
gd_grpApplicationDescription.widthHint = 152;
grpApplicationDescription.setLayoutData(gd_grpApplicationDescription);
grpApplicationDescription.setText("Application Description");
grpApplicationDescription.setLayout(new FillLayout(SWT.VERTICAL));
btnCreateAndEdit = new Button(grpApplicationDescription, SWT.NONE);
btnCreateAndEdit.setText("Create and Edit");
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
DashboardView containingPart;
private void addCommandCallingListener(Button btn, String commandID, String featureName) {
btn.addSelectionListener(new CommandCallingListener(containingPart, commandID, featureName));
}
/**
* Use this method to create all the buttonlisteners, and assign them to
* their respective buttons.
*/
protected void createActions(DashboardView containingPart) {
this.containingPart = containingPart;
// Project
addCommandCallingListener(btnCreate,"org.universaal.tools.newwizard.plugin.command.startNewWizard", "AAL Studio Project Wizards");
// btnImportProject.addSelectionListener(new TemporaryListener(this, "Import Project"));
addCommandCallingListener(btnImportExample,"org.universaal.importexternalproject.commands.importexample", "AAL Studio integration with Developer Depot");
//Java Classes
addCommandCallingListener(btnCreateClass,"org.universaal.tools.newwizard.plugin.command.startNewItemWizard", "AAL Studio Project Wizards");
// btnImportClass.addSelectionListener(new TemporaryListener(this, "Import Class"));
//Extract configuration
addCommandCallingListener(btnExtractParameters, "org.universaal.tools.configurationExtractor.ExtractorAction", "AAL Studio Configuration Extractor");
//Application Binary
// btnTestConformance.addSelectionListener(new TemporaryListener(this, "Test Conformance"));
addCommandCallingListener(btnRun,"org.universaal.tools.buildserviceapplication.actions.RunAction", "AAL Studio Build");
addCommandCallingListener(btnDebug,"org.universaal.tools.buildserviceapplication.actions.DebugAction", "AAL Studio Build");
//Project Description
addCommandCallingListener(btnCreateAndEdit,"org.universaal.tools.uploadopensourceplugin.generateaalapp", "AAL Studio integration with Developer Depot");
//Publishable Application
addCommandCallingListener(btnPublishOpenSource,"org.universaal.tools.uploadopensourceplugin.commands.uploadopensource", "AAL Studio integration with Developer Depot");
addCommandCallingListener(btnPublishToUStore,"org.universaal.tools.buildserviceapplication.actions.PublishAction", "AAL Studio Build");
// Transitions
addCommandCallingListener(btnBuild,"org.universaal.tools.buildserviceapplication.actions.BuildAction", "AAL Studio Build");
//addCommandCallingListener(btnTransform,"org.universaal.tools.transformationcommand.commands.ontUML2Java", "AAL Studio Transformations");
}
}
......@@ -95,35 +95,26 @@ public class DashboardView extends ViewPart {
TabItem tbtmCreatingAnAal = new TabItem(tabFolder, SWT.NONE);
tbtmCreatingAnAal.setText("Creating an AAL Service");
MySWT mySWT = new MySWT(tabFolder, SWT.NONE);
tbtmCreatingAnAal.setControl(mySWT);
ApplicationView applicationView = new ApplicationView(tabFolder, SWT.NONE);
applicationView.createActions(this);
tbtmCreatingAnAal.setControl(applicationView);
TabItem tbtmOntologyProject = new TabItem(tabFolder, SWT.NONE);
tbtmOntologyProject.setText("Creating an Ontology");
OntologyView ontologyView2 = new OntologyView(tabFolder, SWT.NONE);
ontologyView2.createActions(this);
tbtmOntologyProject.setControl(ontologyView2);
new Label(ontologyView2, SWT.NONE);
OntologyView ontologyView = new OntologyView(tabFolder, SWT.NONE);
ontologyView.createActions(this);
tbtmOntologyProject.setControl(ontologyView);
}
scrolledComposite.setContent(tabFolder);
scrolledComposite.setMinSize(tabFolder.computeSize(SWT.DEFAULT, SWT.DEFAULT));
createActions();
initializeToolBar();
initializeMenu();
hookPageSelection();
}
/**
* Use this method to create all the buttonlisteners, and assign them to
* their respective buttons.
*/
private void createActions() {
}
/**
* Initialize the toolbar.
*/
......
package org.universaal.tools.dashboard.views;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
public class MySWT extends Composite {
/**
* Create the composite.
* @param parent
* @param style
*/
public MySWT(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout(2, false));
Combo combo = new Combo(this, SWT.NONE);
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
new Label(this, SWT.NONE);
Button btnCheckButton = new Button(this, SWT.CHECK);
btnCheckButton.setText("Check Button");
new Label(this, SWT.NONE);
Label lblNewLabel = new Label(this, SWT.NONE);
lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblNewLabel.setText("New Label");
Combo combo_1 = new Combo(this, SWT.NONE);
combo_1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
}
@Override
protected void checkSubclass() {
// Disable the check that prevents subclassing of SWT components
}
}
......@@ -41,7 +41,7 @@ import org.universaal.tools.dashboard.buttonlisteners.old.UploadOpenSourceListen
import org.universaal.tools.dashboard.listeners.ProjectElementSelectionListener;
public class ApplicationView extends Composite {
public class OldApplicationView extends Composite {
private Button btnImportProject;
private Button btnCreateClass;
......@@ -71,7 +71,7 @@ public class ApplicationView extends Composite {
* @param parent
* @param style
*/
public ApplicationView(Composite parent, int style) {
public OldApplicationView(Composite parent, int style) {
super(parent, style);
ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
scrolledComposite.setExpandHorizontal(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment