Issue #343 remove extra perspectives when in thinclient component

Change-Id: Ibb6cee8d10a541e2defac098e844c23798a1deee

Former-commit-id: f5205ce3a2 [formerly 7abc89a7d0] [formerly 0104e1970d] [formerly 0104e1970d [formerly 28c7e6bc22]] [formerly 8cf7360e3b [formerly 0104e1970d [formerly 28c7e6bc22] [formerly 8cf7360e3b [formerly cb03ef54be5e9dae57d758903f6956a8c2a9a617]]]]
Former-commit-id: 8cf7360e3b
Former-commit-id: 71c33a0330bbc622406ff829c9c6db445efcae7a [formerly 47e1a23d52597de86c39cbd5e06efa8089017300] [formerly 7de650c868 [formerly b819bfa8e9]]
Former-commit-id: 7de650c868
Former-commit-id: e55c51da39
This commit is contained in:
Ben Steffensmeier 2012-02-15 17:10:34 -06:00
parent 6e0827e7e6
commit b62c499d34
6 changed files with 86 additions and 19 deletions

View file

@ -107,7 +107,7 @@ public class BundleScanner {
String pathToLookFor, Map<String, Bundle> toSearch) {
File file = null;
Bundle b = toSearch.get(bundleToSearch);
if (b != null) {
if (b != null && b.getState() != Bundle.UNINSTALLED) {
URL url = FileLocator.find(b, new Path(basePath + File.separator
+ pathToLookFor), null);
if (url != null) {

View file

@ -0,0 +1,41 @@
# Warngen
com.raytheon.viz.warngen
# GFe Perspective
com.raytheon.viz.gfe
com.raytheon.viz.ghg
# AvnFPS
com.raytheon.viz.aviation
com.raytheon.viz.avnconfig
# MPE
com.raytheon.viz.mpe
com.raytheon.viz.mpe.ui
# Hydro
com.raytheon.viz.hydrobase
com.raytheon.viz.hydrocommon
com.raytheon.viz.hydro
# ncep
gov.noaa.nws.ncep.viz.ui.perspectives
gov.noaa.nws.ncep.ui.nctextui
gov.noaa.nws.ncep.viz.cloudHeight
gov.noaa.nws.ncep.viz.rsc.airmet
gov.noaa.nws.ncep.viz.rsc.atcf
gov.noaa.nws.ncep.viz.rsc.convsigmet
gov.noaa.nws.ncep.viz.rsc.ffa
gov.noaa.nws.ncep.viz.rsc.ffg
gov.noaa.nws.ncep.viz.rsc.idft
gov.noaa.nws.ncep.viz.rsc.intlsig
gov.noaa.nws.ncep.viz.rsc.lightning
gov.noaa.nws.ncep.viz.rsc.mosaic
gov.noaa.nws.ncep.viz.rsc.ncscat
gov.noaa.nws.ncep.viz.rsc.nonconvsigmet
gov.noaa.nws.ncep.viz.rsc.plotdata
gov.noaa.nws.ncep.viz.rsc.satellite
gov.noaa.nws.ncep.viz.rsc.svrl
gov.noaa.nws.ncep.viz.rsc.warn
gov.noaa.nws.ncep.viz.rsc.wcn
gov.noaa.nws.ncep.viz.rsc.wcp
gov.noaa.nws.ncep.viz.rsc.wstm
gov.noaa.nws.ncep.viz.rsc.wou
#localization
com.raytheon.uf.viz.localization.perspective
org.eclipse.wst.xml.ui

View file

@ -2,4 +2,5 @@ source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml
plugin.xml,\
ThinClientPluginBlacklist.txt

View file

@ -19,6 +19,12 @@
**/
package com.raytheon.uf.viz.thinclient.cave;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.JAXBException;
import org.eclipse.jface.preference.IPreferenceStore;
@ -30,6 +36,7 @@ import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.localization.BundleScanner;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.thinclient.Activator;
import com.raytheon.uf.viz.thinclient.IThinClientComponent;
@ -105,11 +112,23 @@ public class ThinClientComponent extends CAVE implements IThinClientComponent {
Activator.getDefault().setComponent(this);
ThinClientURICatalog.getInstance();
List<String> pluginBlacklist = new ArrayList<String>();
File blacklistFile = BundleScanner.searchInBundle(
com.raytheon.uf.viz.thinclient.cave.Activator.PLUGIN_ID, "",
"ThinClientPluginBlacklist.txt");
if (blacklistFile != null && blacklistFile.exists()) {
BufferedReader reader = new BufferedReader(new FileReader(
blacklistFile));
String line = null;
while (null != (line = reader.readLine())) {
pluginBlacklist.add(line.trim());
}
}
try {
for (Bundle b : Activator.getDefault().getContext().getBundles()) {
if ("com.raytheon.viz.warngen".equals(b.getSymbolicName())) {
if (pluginBlacklist.contains(b.getSymbolicName())) {
b.stop();
b.uninstall();
break;
}
}
} catch (Throwable t) {

View file

@ -20,6 +20,26 @@
-->
<?eclipse version="3.3"?>
<plugin>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:file.new.Aviation">
<command
commandId="com.raytheon.viz.aviation.openaviation"
label="AvnFPS Menu ..."
style="push">
</command>
<separator
name="xxx"
visible="true">
</separator>
<command
commandId="com.raytheon.viz.aviation.openavnconfig"
label="Configuration GUI ..."
style="push">
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.ui.commands">
<command

View file

@ -50,21 +50,7 @@
label="Text Workstation"
style="push">
</command>
<menu label="Aviation">
<command
commandId="com.raytheon.viz.aviation.openaviation"
label="AvnFPS Menu ..."
style="push">
</command>
<separator
name="xxx"
visible="true">
</separator>
<command
commandId="com.raytheon.viz.aviation.openavnconfig"
label="Configuration GUI ..."
style="push">
</command>
<menu id="file.new.Aviation" label="Aviation">
</menu>
</menu>
<menu id="perspectives" label="Perspective">