Commit 206dc1c0 authored by Daniel Ratiu's avatar Daniel Ratiu
Browse files

resolving the issue

refs 462
parent a0c9f1af
......@@ -109,6 +109,12 @@
id="org.fortiss.af3.rcp.application.nondeterminismAnalysesAction"
name="Non-determinism Analyses">
</command>
<command
categoryId="org.eclipse.ui.category.views"
defaultHandler="org.fortiss.af3.rcp.application.handler.ApplicationCommandHandler$ShowErrorLogCommandHandler"
id="org.fortiss.af3.rcp.application.showErrorLogAction"
name="Show Error Log">
</command>
</extension>
<extension
point="org.eclipse.help.toc">
......
......@@ -35,7 +35,7 @@ import org.fortiss.af3.rcp.application.advisors.ApplicationWorkbenchAdvisor;
* @author ratiu
* @author $Author: hoelzlf $
* @version $Rev: 6104 $
* @ConQAT.Rating YELLOW Hash: F82FA7918455508AD7C4F1093C9FA3B1
* @ConQAT.Rating GREEN Hash: A36C97DFE1CB62AEA03128ABD29F5550
*/
public class AF3Application implements IApplication {
......
......@@ -27,8 +27,8 @@ import org.osgi.framework.BundleContext;
* @author ratiu
* @author $Author: hoelzl $
* @version $Rev: 769 $
* @ConQAT.Rating YELLOW Hash: BBCE543637A7A9DB53FC1D54C119E98B
*/
* @ConQAT.Rating GREEN Hash: F04E928B122440F20A6EF12F46855172
*/
public class Activator extends AbstractUIPlugin {
/** The ID of this plug-in. */
......@@ -59,10 +59,6 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns an image descriptor for the image file at the given plug-in
* relative path
*
* @param path
* the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
......
......@@ -18,6 +18,20 @@ $Id: AF3Application.java 769 2011-06-14 13:18:26Z ratiu $
package org.fortiss.af3.rcp.application.advisors;
import static org.eclipse.ui.actions.ActionFactory.ABOUT;
import static org.eclipse.ui.actions.ActionFactory.COPY;
import static org.eclipse.ui.actions.ActionFactory.CUT;
import static org.eclipse.ui.actions.ActionFactory.DELETE;
import static org.eclipse.ui.actions.ActionFactory.HELP_CONTENTS;
import static org.eclipse.ui.actions.ActionFactory.NEW_WIZARD_DROP_DOWN;
import static org.eclipse.ui.actions.ActionFactory.PASTE;
import static org.eclipse.ui.actions.ActionFactory.PREFERENCES;
import static org.eclipse.ui.actions.ActionFactory.QUIT;
import static org.eclipse.ui.actions.ActionFactory.REDO;
import static org.eclipse.ui.actions.ActionFactory.SAVE;
import static org.eclipse.ui.actions.ActionFactory.UNDO;
import static org.eclipse.wb.swt.ResourceManager.getPluginImageDescriptor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.ICoolBarManager;
......@@ -27,7 +41,6 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
......@@ -36,7 +49,6 @@ import org.eclipse.ui.internal.actions.CommandAction;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.ui.internal.registry.ActionSetRegistry;
import org.eclipse.ui.internal.registry.IActionSetDescriptor;
import org.eclipse.wb.swt.ResourceManager;
/**
* Action bar advisor for AF3 RCP.
......@@ -44,11 +56,13 @@ import org.eclipse.wb.swt.ResourceManager;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 2691 $
* @ConQAT.Rating YELLOW Hash: 552D965BDDB36A9D1768BF1D4C8CA406
* @ConQAT.Rating GREEN Hash: 2204234ADC5CDA1208967EDB81D6034B
*/
@SuppressWarnings("restriction")
public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
// standard Eclipse actions
// //////// standard Eclipse actions //////////////////
/** Standard Eclipse Preferences Action */
private IWorkbenchAction openPreferencesAction;
......@@ -85,7 +99,8 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
/** Standard Eclipse About Action */
private IAction aboutAction;
// AF3 specific actions
// //////// AF3 specific actions //////////////////
/** AF3-Specific Action to crate a new empty project */
private static WorkbenchCommandAction newAF3ProjectAction;
......@@ -98,6 +113,9 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
/** Open the "Non-determinism Analysis" view. */
private static WorkbenchCommandAction openNondeterminismAnalysesAction;
/** Open the "Error Log". */
private static WorkbenchCommandAction showErrorLogAction;
/**
* AF3-Specific Action to open the SimpleTrafficLights-Example
* (Code-Specification Variant)
......@@ -110,12 +128,6 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
/** AF3-Specific Export Action */
private static WorkbenchCommandAction exportAF3ProjectsAction;
/** Restore the AF3 perspective to show its initial default views */
private static WorkbenchCommandAction restoreAF3PerspectiveAction;
/** Restore the Simulator perspective to show its initial default views */
private static WorkbenchCommandAction restoreSimPerspectiveAction;
/** class used to define an command action */
private static class WorkbenchCommandAction extends CommandAction implements
IWorkbenchAction {
......@@ -132,177 +144,138 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
super(configurer);
}
/** Initiates the actions */
/** {@inheritDoc} */
@Override
protected void makeActions(IWorkbenchWindow window) {
{
newWizardDropDownAction = ActionFactory.NEW_WIZARD_DROP_DOWN
.create(window);
register(newWizardDropDownAction);
}
{
saveAction = ActionFactory.SAVE.create(window);
register(saveAction);
}
{
openPreferencesAction = ActionFactory.PREFERENCES.create(window);
register(openPreferencesAction);
}
{
// Actions for invisible accelerators
quitAction = ActionFactory.QUIT.create(window);
register(quitAction);
}
{
undoAction = ActionFactory.UNDO.create(window);
register(undoAction);
}
{
redoAction = ActionFactory.REDO.create(window);
register(redoAction);
}
{
cutAction = ActionFactory.CUT.create(window);
register(cutAction);
}
{
copyAction = ActionFactory.COPY.create(window);
register(copyAction);
}
{
pasteAction = ActionFactory.PASTE.create(window);
register(pasteAction);
}
{
deleteAction = ActionFactory.DELETE.create(window);
register(deleteAction);
}
{
String actionText = "New AF3 Project";
newAF3ProjectAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.newaf3project", window);
newAF3ProjectAction.setText(actionText);
newAF3ProjectAction.setToolTipText(actionText);
newAF3ProjectAction.setDescription(actionText);
newAF3ProjectAction.setId(actionText.replaceAll(" ", ""));
newAF3ProjectAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor(
"org.fortiss.af3.rcp.application",
"icons/new_project.png"));
register(newAF3ProjectAction);
}
{
String actionText = "Load Simple Traffic Lights Example";
openSimpleTrafficLightsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.loadsimpletrafficlightsexample",
window);
openSimpleTrafficLightsAction.setText(actionText);
openSimpleTrafficLightsAction.setToolTipText(actionText);
openSimpleTrafficLightsAction.setDescription(actionText);
openSimpleTrafficLightsAction.setId(actionText.replaceAll(" ", ""));
register(openSimpleTrafficLightsAction);
}
{
String actionText = "Load Example for Code-Specifications";
openSimpleTrafficLightsAction_CodeSpec = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.loadsimpletrafficlightsexample_codespec",
window);
openSimpleTrafficLightsAction_CodeSpec.setText(actionText);
openSimpleTrafficLightsAction_CodeSpec.setToolTipText(actionText);
openSimpleTrafficLightsAction_CodeSpec.setDescription(actionText);
openSimpleTrafficLightsAction_CodeSpec.setId(actionText.replaceAll(
" ", ""));
register(openSimpleTrafficLightsAction_CodeSpec);
}
{
importAF3ProjectsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.importaf3project", window);
importAF3ProjectsAction.setId("importAF3ProjectsAction");
importAF3ProjectsAction.setToolTipText("Import AF3-Project");
importAF3ProjectsAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor("org.eclipse.ui",
"/icons/full/etool16/import_wiz.gif"));
importAF3ProjectsAction.setText("&Import AF3-Project");
register(importAF3ProjectsAction);
}
{
exportAF3ProjectsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.exportaf3project", window);
exportAF3ProjectsAction.setId("exportAF3ProjectsAction");
exportAF3ProjectsAction.setToolTipText("Export AF3-Project");
exportAF3ProjectsAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor("org.eclipse.ui",
"/icons/full/etool16/export_wiz.gif"));
exportAF3ProjectsAction.setText("&Export AF3-Project");
register(exportAF3ProjectsAction);
}
{
helpContentsAction = ActionFactory.HELP_CONTENTS.create(window);
helpContentsAction.setId("helpContentsAction");
helpContentsAction.setToolTipText("AF3 Help");
helpContentsAction.setText("AF3 &Help");
register(helpContentsAction);
}
{
aboutAction = ActionFactory.ABOUT.create(window);
aboutAction.setId("aboutAction");
aboutAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor(
"org.fortiss.af3.rcp.application",
"icons/dock_icons/icon16.png"));
aboutAction.setText("&About AutoFOCUS3");
aboutAction.setToolTipText("About AutoFOCUS3");
aboutAction.setDescription("About AutoFOCUS3");
register(aboutAction);
}
{
restoreAF3PerspectiveAction = new WorkbenchCommandAction(
"Restore AF3 Perspective", window);
restoreAF3PerspectiveAction.setEnabled(false);
restoreAF3PerspectiveAction.setId("restoreAF3PerspectiveAction");
restoreAF3PerspectiveAction
.setToolTipText("restore AF3 Perspective");
restoreAF3PerspectiveAction.setText("restore AF3 Perspective");
register(restoreAF3PerspectiveAction);
}
{
restoreSimPerspectiveAction = new WorkbenchCommandAction(
"Restore Simulator Perspective", window);
restoreSimPerspectiveAction.setEnabled(false);
restoreSimPerspectiveAction.setId("restoreSimPerspectiveAction");
restoreSimPerspectiveAction
.setToolTipText("restore Simulator Perspective");
restoreSimPerspectiveAction
.setText("restore Simulator Perspective");
register(restoreSimPerspectiveAction);
}
{
openSemanticInspectorAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.semanticInspectorAction",
window);
openSemanticInspectorAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor("org.fortiss.af3.analyses.ui",
"icons/semanticinspect.gif"));
openSemanticInspectorAction.setText("Semantic Inspector");
openSemanticInspectorAction.setToolTipText("Semantic Inspector");
openSemanticInspectorAction.setDescription("Semantic Inspector");
register(openSemanticInspectorAction);
}
{
openNondeterminismAnalysesAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.nondeterminismAnalysesAction",
window);
openNondeterminismAnalysesAction.setImageDescriptor(ResourceManager
.getPluginImageDescriptor("org.fortiss.af3.analyses.ui",
"icons/nondeterminism.gif"));
openNondeterminismAnalysesAction
.setText("Non-determinism Analyses");
openNondeterminismAnalysesAction
.setToolTipText("Non-determinism Analyses");
openNondeterminismAnalysesAction
.setDescription("Non-determinism Analyses");
register(openNondeterminismAnalysesAction);
}
newWizardDropDownAction = NEW_WIZARD_DROP_DOWN.create(window);
register(newWizardDropDownAction);
saveAction = SAVE.create(window);
register(saveAction);
openPreferencesAction = PREFERENCES.create(window);
register(openPreferencesAction);
// Actions for invisible accelerators
quitAction = QUIT.create(window);
register(quitAction);
undoAction = UNDO.create(window);
register(undoAction);
redoAction = REDO.create(window);
register(redoAction);
cutAction = CUT.create(window);
register(cutAction);
copyAction = COPY.create(window);
register(copyAction);
pasteAction = PASTE.create(window);
register(pasteAction);
deleteAction = DELETE.create(window);
register(deleteAction);
String actionText = "New AF3 Project";
newAF3ProjectAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.newaf3project", window);
newAF3ProjectAction.setText(actionText);
newAF3ProjectAction.setToolTipText(actionText);
newAF3ProjectAction.setDescription(actionText);
newAF3ProjectAction.setId(actionText.replaceAll(" ", ""));
newAF3ProjectAction.setImageDescriptor(getPluginImageDescriptor(
"org.fortiss.af3.rcp.application", "icons/new_project.png"));
register(newAF3ProjectAction);
actionText = "Load Simple Traffic Lights Example";
openSimpleTrafficLightsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.loadsimpletrafficlightsexample",
window);
openSimpleTrafficLightsAction.setText(actionText);
openSimpleTrafficLightsAction.setToolTipText(actionText);
openSimpleTrafficLightsAction.setDescription(actionText);
openSimpleTrafficLightsAction.setId(actionText.replaceAll(" ", ""));
register(openSimpleTrafficLightsAction);
actionText = "Load Example for Code-Specifications";
openSimpleTrafficLightsAction_CodeSpec = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.loadsimpletrafficlightsexample_codespec",
window);
openSimpleTrafficLightsAction_CodeSpec.setText(actionText);
openSimpleTrafficLightsAction_CodeSpec.setToolTipText(actionText);
openSimpleTrafficLightsAction_CodeSpec.setDescription(actionText);
openSimpleTrafficLightsAction_CodeSpec.setId(actionText.replaceAll(" ",
""));
register(openSimpleTrafficLightsAction_CodeSpec);
importAF3ProjectsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.importaf3project", window);
importAF3ProjectsAction.setId("importAF3ProjectsAction");
importAF3ProjectsAction.setToolTipText("Import AF3-Project");
importAF3ProjectsAction.setImageDescriptor(getPluginImageDescriptor(
"org.eclipse.ui", "/icons/full/etool16/import_wiz.gif"));
importAF3ProjectsAction.setText("&Import AF3-Project");
register(importAF3ProjectsAction);
exportAF3ProjectsAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.exportaf3project", window);
exportAF3ProjectsAction.setId("exportAF3ProjectsAction");
exportAF3ProjectsAction.setToolTipText("Export AF3-Project");
exportAF3ProjectsAction.setImageDescriptor(getPluginImageDescriptor(
"org.eclipse.ui", "/icons/full/etool16/export_wiz.gif"));
exportAF3ProjectsAction.setText("&Export AF3-Project");
register(exportAF3ProjectsAction);
helpContentsAction = HELP_CONTENTS.create(window);
helpContentsAction.setId("helpContentsAction");
helpContentsAction.setToolTipText("AF3 Help");
helpContentsAction.setText("AF3 &Help");
register(helpContentsAction);
aboutAction = ABOUT.create(window);
aboutAction.setId("aboutAction");
aboutAction.setImageDescriptor(getPluginImageDescriptor(
"org.fortiss.af3.rcp.application",
"icons/dock_icons/icon16.png"));
aboutAction.setText("&About AutoFOCUS3");
aboutAction.setToolTipText("About AutoFOCUS3");
aboutAction.setDescription("About AutoFOCUS3");
register(aboutAction);
openSemanticInspectorAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.semanticInspectorAction",
window);
openSemanticInspectorAction
.setImageDescriptor(getPluginImageDescriptor(
"org.fortiss.af3.analyses.ui",
"icons/semanticinspect.gif"));
openSemanticInspectorAction.setText("Semantic Inspector");
openSemanticInspectorAction.setToolTipText("Semantic Inspector");
openSemanticInspectorAction.setDescription("Semantic Inspector");
register(openSemanticInspectorAction);
openNondeterminismAnalysesAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.nondeterminismAnalysesAction",
window);
openNondeterminismAnalysesAction
.setImageDescriptor(getPluginImageDescriptor(
"org.fortiss.af3.analyses.ui",
"icons/nondeterminism.gif"));
openNondeterminismAnalysesAction.setText("Non-determinism Analyses");
openNondeterminismAnalysesAction
.setToolTipText("Non-determinism Analyses");
openNondeterminismAnalysesAction
.setDescription("Non-determinism Analyses");
register(openNondeterminismAnalysesAction);
showErrorLogAction = new WorkbenchCommandAction(
"org.fortiss.af3.rcp.application.showErrorLogAction", window);
showErrorLogAction.setImageDescriptor(getPluginImageDescriptor(
"org.fortiss.af3.rcp.application", "icons/error_smiley.jpg"));
showErrorLogAction.setText("Show Error Log");
register(showErrorLogAction);
}
/**
......@@ -346,7 +319,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
}
}
/** initiated the CoolBar */
/** {@inheritDoc} */
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
ToolBarManager toolBarManager = new ToolBarManager();
......@@ -358,49 +331,49 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
toolBarManager.add(openNondeterminismAnalysesAction);
}
/** initiated the MenuBar */
/** {@inheritDoc} */
@Override
protected void fillMenuBar(IMenuManager menuBar) {
removeNotInterestingActionSets();
// FileMenu
MenuManager FileMenu = new MenuManager(
MenuManager fileMenu = new MenuManager(
IDEWorkbenchMessages.Workbench_file,
IWorkbenchActionConstants.M_FILE);
menuBar.add(FileMenu);
FileMenu.add(newAF3ProjectAction);
menuBar.add(fileMenu);
fileMenu.add(newAF3ProjectAction);
MenuManager openAF3ExampleMenuManager = new MenuManager(
"Open AF3 Example");
FileMenu.add(openAF3ExampleMenuManager);
fileMenu.add(openAF3ExampleMenuManager);
openAF3ExampleMenuManager.add(openSimpleTrafficLightsAction);
openAF3ExampleMenuManager.add(openSimpleTrafficLightsAction_CodeSpec);
FileMenu.add(new Separator());
FileMenu.add(saveAction);
FileMenu.add(new Separator());
FileMenu.add(importAF3ProjectsAction);
FileMenu.add(exportAF3ProjectsAction);
fileMenu.add(new Separator());
fileMenu.add(saveAction);
fileMenu.add(new Separator());
fileMenu.add(importAF3ProjectsAction);
fileMenu.add(exportAF3ProjectsAction);
// EditMenu
MenuManager EditMenu = new MenuManager(
MenuManager editMenu = new MenuManager(
IDEWorkbenchMessages.Workbench_edit,
IWorkbenchActionConstants.M_EDIT);
menuBar.add(EditMenu);
EditMenu.add(undoAction);
EditMenu.add(redoAction);
EditMenu.add(new Separator());
EditMenu.add(cutAction);
EditMenu.add(copyAction);
EditMenu.add(pasteAction);
EditMenu.add(new Separator());
EditMenu.add(deleteAction);
menuBar.add(editMenu);
editMenu.add(undoAction);
editMenu.add(redoAction);
editMenu.add(new Separator());
editMenu.add(cutAction);
editMenu.add(copyAction);
editMenu.add(pasteAction);
editMenu.add(new Separator());
editMenu.add(deleteAction);
// Help Menu
MenuManager HelpMenu = new MenuManager("&Help");
menuBar.add(HelpMenu);
HelpMenu.add(aboutAction);
HelpMenu.add(helpContentsAction);
MenuManager helpMenu = new MenuManager("&Help");
menuBar.add(helpMenu);
helpMenu.add(aboutAction);
helpMenu.add(helpContentsAction);
helpMenu.add(showErrorLogAction);
}
/** returns defined action to create new AF3 Project */
......
......@@ -22,6 +22,7 @@ import java.util.HashSet;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.activities.IWorkbenchActivitySupport;
import org.eclipse.ui.application.IWorkbenchConfigurer;
......@@ -37,13 +38,16 @@ import org.fortiss.af3.rcp.application.utils.ApplicationUtils;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 6104 $
* @ConQAT.Rating YELLOW Hash: 5D7954C50A8EF3CA06AE556C4DDFB83D
* @ConQAT.Rating GREEN Hash: BA2E43EAC55989353779B006BAC96C9F
*/
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
/** The name of the main perspective. */
/** The ID of the main perspective. */
private static final String PERSPECTIVE_ID = "org.fortiss.af3.project.ui.perspective";
/** The name of the main perspective. */
public static final String PERSPECTIVE_NAME = "AF3 Perspective";
/** {@inheritDoc} */
@Override
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
......@@ -66,15 +70,14 @@ public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
/** {@inheritDoc} */
@Override
public void postStartup() {
IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench()