diff --git a/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF b/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF index 9eb8658..7b118c2 100644 --- a/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF +++ b/plugins/com.minres.scviewer.ui/META-INF/MANIFEST.MF @@ -17,7 +17,9 @@ Require-Bundle: com.minres.scviewer.database;bundle-version="1.0.0", org.eclipse.swt, org.eclipse.osgi, org.eclipse.core.expressions;bundle-version="3.4.600", - org.eclipse.jface + org.eclipse.jface, + org.eclipse.ui.console, + org.eclipse.jdt.ui Bundle-RequiredExecutionEnvironment: JavaSE-17 Bundle-ActivationPolicy: lazy Import-Package: com.google.common.collect diff --git a/plugins/com.minres.scviewer.ui/plugin.xml b/plugins/com.minres.scviewer.ui/plugin.xml index b94bcc1..008697e 100644 --- a/plugins/com.minres.scviewer.ui/plugin.xml +++ b/plugins/com.minres.scviewer.ui/plugin.xml @@ -20,10 +20,11 @@ @@ -372,5 +373,14 @@ icon="res/images/cross.png"> + + + + diff --git a/plugins/com.minres.scviewer.ui/src/SCViewerMatchingStrategy.java b/plugins/com.minres.scviewer.ui/src/SCViewerMatchingStrategy.java new file mode 100644 index 0000000..fa7ee13 --- /dev/null +++ b/plugins/com.minres.scviewer.ui/src/SCViewerMatchingStrategy.java @@ -0,0 +1,14 @@ +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorMatchingStrategy; +import org.eclipse.ui.IEditorReference; + +public class SCViewerMatchingStrategy implements IEditorMatchingStrategy { + + @Override + public boolean matches(IEditorReference editorRef, IEditorInput input) { + return input.getName().endsWith(".ftr") || input.getName().endsWith(".fst") + || input.getName().endsWith(".vcd") || input.getName().endsWith(".txlog") + || input.getName().endsWith(".txlog.gz") || input.getName().endsWith(".txdb"); + } + +} diff --git a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/perspectives/WaveformPerspective.java b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/perspectives/WaveformPerspective.java new file mode 100644 index 0000000..7e5c424 --- /dev/null +++ b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/perspectives/WaveformPerspective.java @@ -0,0 +1,90 @@ +package com.minres.scviewer.ui.perspectives; + +import org.eclipse.ui.IFolderLayout; +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; +import org.eclipse.ui.console.IConsoleConstants; +import org.eclipse.jdt.ui.JavaUI; + + +/** + * This class is meant to serve as an example for how various contributions + * are made to a perspective. Note that some of the extension point id's are + * referred to as API constants while others are hardcoded and may be subject + * to change. + */ +public class WaveformPerspective implements IPerspectiveFactory { + + private IPageLayout factory; + + public WaveformPerspective() { + super(); + } + + public void createInitialLayout(IPageLayout factory) { + this.factory = factory; + addViews(); + addActionSets(); + addNewWizardShortcuts(); + addPerspectiveShortcuts(); + addViewShortcuts(); + } + + private void addViews() { + // Creates the overall folder layout. + // Note that each new Folder uses a percentage of the remaining EditorArea. + IFolderLayout topLeft = + factory.createFolder( + "topLeft", //NON-NLS-1 + IPageLayout.LEFT, + 0.25f, + factory.getEditorArea()); + topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER); + + IFolderLayout bottomLeft = + factory.createFolder( + "bottomLeft", //NON-NLS-1 + IPageLayout.BOTTOM, + 0.25f, + "topLeft"); + bottomLeft.addView(IPageLayout.ID_OUTLINE); + + IFolderLayout bottom = + factory.createFolder( + "bottomRight", //NON-NLS-1 + IPageLayout.BOTTOM, + 0.75f, + factory.getEditorArea()); + bottom.addView(IPageLayout.ID_PROP_SHEET); + bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); + } + + private void addActionSets() { + factory.addActionSet(JavaUI.ID_ACTION_SET); + factory.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); + factory.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); //NON-NLS-1 + } + + private void addPerspectiveShortcuts() { + factory.addPerspectiveShortcut("org.eclipse.team.ui.TeamSynchronizingPerspective"); //NON-NLS-1 + factory.addPerspectiveShortcut("org.eclipse.ui.resourcePerspective"); //NON-NLS-1 + } + + private void addNewWizardShortcuts() { + factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//NON-NLS-1 + factory.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//NON-NLS-1 + } + + private void addViewShortcuts() { + factory.addShowViewShortcut("org.eclipse.ant.ui.views.AntView"); //NON-NLS-1 + factory.addShowViewShortcut("org.eclipse.pde.ui.DependenciesView"); //NON-NLS-1 + factory.addShowViewShortcut("org.eclipse.jdt.junit.ResultView"); //NON-NLS-1 + factory.addShowViewShortcut("org.eclipse.team.ui.GenericHistoryView"); //NON-NLS-1 + factory.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); + factory.addShowViewShortcut(JavaUI.ID_PACKAGES); + factory.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER); + factory.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); + factory.addShowViewShortcut(IPageLayout.ID_OUTLINE); + } + +} diff --git a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java index 53f3dbc..f18ee14 100644 --- a/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java +++ b/plugins/com.minres.scviewer.ui/src/com/minres/scviewer/ui/views/provider/TxDbTreeLabelProvider.java @@ -26,23 +26,13 @@ public class TxDbTreeLabelProvider implements ILabelProvider { private List listeners = new ArrayList(); - private Image database; - private Image stream; - private Image signal; - private Image folder; - private Image wave; + private static Image database=TxEditorPlugin.createImage("database"); + private static Image stream=TxEditorPlugin.createImage("stream"); + private static Image signal=TxEditorPlugin.createImage("signal"); + private static Image folder=TxEditorPlugin.createImage("folder"); + private static Image wave=TxEditorPlugin.createImage("wave"); - public TxDbTreeLabelProvider() { - super(); - database=TxEditorPlugin.createImage("database"); - stream=TxEditorPlugin.createImage("stream"); - folder=TxEditorPlugin.createImage("folder"); - signal=TxEditorPlugin.createImage("signal"); - wave=TxEditorPlugin.createImage("wave"); - - } - @Override public void addListener(ILabelProviderListener listener) { listeners.add(listener);