Issue #2602 Switch around the order of some things on startup to make thinclient better.
Former-commit-id:a37db9d1b4
[formerly 41f4a0a6050319adf27f3656b665a2fb011b849c] Former-commit-id:922674273e
This commit is contained in:
parent
6811b0e5c1
commit
4a86c90bfc
23 changed files with 536 additions and 481 deletions
|
@ -69,9 +69,7 @@
|
|||
</property>
|
||||
<property name="arguments" ref="recordFactory" />
|
||||
</bean>
|
||||
|
||||
<bean id="procedureXmlManagerInit" class="com.raytheon.uf.viz.core.procedures.ProcedureXmlManager" factory-method="inititializeAsync"/>
|
||||
|
||||
|
||||
<bean id="vizSubClassLocator" class="com.raytheon.uf.viz.core.reflect.SubClassLocator"/>
|
||||
<bean class="com.raytheon.uf.common.style.StyleManager" factory-method="getInstance">
|
||||
<property name="subClassLocator" ref="vizSubClassLocator" />
|
||||
|
|
|
@ -52,8 +52,10 @@ import com.raytheon.uf.viz.core.Activator;
|
|||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- --------------------------
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Oct 18, 2013 2491 bsteffen Initial creation
|
||||
* Dec 10, 2013 2602 bsteffen Add null checks to detect unloaded
|
||||
* bundles.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -256,7 +258,13 @@ public class SubClassLocator implements ISubClassLocator {
|
|||
private Set<Class<?>> loadClassesFromCache(Bundle bundle,
|
||||
Collection<String> classNames) {
|
||||
BundleWiring bundleWiring = bundle.adapt(BundleWiring.class);
|
||||
if (bundleWiring == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
ClassLoader loader = bundleWiring.getClassLoader();
|
||||
if (loader == null) {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
HashSet<Class<?>> result = new HashSet<Class<?>>(classNames.size(),
|
||||
1.0f);
|
||||
for (String className : classNames) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension-point id="tearoffperspective" name="tearoffperspective" schema="schema/tearoffperspective.exsd"/>
|
||||
<extension-point id="com.raytheon.uf.viz.ui.menus.contribItemProvider" name="contribItemProvider" schema="schema/com.raytheon.uf.viz.ui.menus.contribItemProvider.exsd"/>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="com.raytheon.uf.viz.ui.menus" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="com.raytheon.uf.viz.ui.menus" id="com.raytheon.uf.viz.ui.menus.contribItemProvider" name="contribItemProvider"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<sequence minOccurs="1" maxOccurs="unbounded">
|
||||
<element ref="contributionItemProvider"/>
|
||||
</sequence>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="id" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="contributionItemProvider">
|
||||
<complexType>
|
||||
<attribute name="contribution" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="itemProvider" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn=":com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
|
@ -37,7 +37,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.viz.core.VariableSubstitutionUtil;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.jobs.JobPool;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.AbstractMenuContributionItem;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
|
||||
/**
|
||||
|
@ -46,11 +46,12 @@ import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 26, 2009 chammack Initial creation
|
||||
* May 08, 2013 1978 bsteffen Perform variable substitution on subMenu
|
||||
* IDs.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Mar 26, 2009 chammack Initial creation
|
||||
* May 08, 2013 1978 bsteffen Perform variable substitution on subMenu
|
||||
* IDs.
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -120,8 +121,8 @@ public class SubmenuContributionItem extends MenuManager {
|
|||
|
||||
for (int i = 0; i < contribs.length; i++) {
|
||||
try {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(contribs[i].getClass());
|
||||
IContribItemProvider amc = MenuXMLMap
|
||||
.getProvider(contribs[i].getClass());
|
||||
contributionItems[i] = amc.getContributionItems(
|
||||
contribs[i], this.subs, this.removals);
|
||||
|
||||
|
|
|
@ -42,14 +42,16 @@ import com.raytheon.uf.viz.ui.menus.DiscoverMenuContributions;
|
|||
import com.raytheon.uf.viz.ui.menus.widgets.SubmenuContributionItem;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Providex ability to include menus from other localization files.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 27, 2009 chammack Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Apr 27, 2009 chammack Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -103,8 +105,8 @@ public class IncludeMenuContribution extends
|
|||
|
||||
if (mtf.contributions != null) {
|
||||
for (CommonAbstractMenuContribution c : mtf.contributions) {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(c.getClass());
|
||||
IContribItemProvider amc = MenuXMLMap.getProvider(c
|
||||
.getClass());
|
||||
IContributionItem[] contribItems = amc
|
||||
.getContributionItems(c, combinedSub, removals);
|
||||
if (contribItems != null && contribItems.length > 0) {
|
||||
|
|
|
@ -52,9 +52,10 @@ import com.raytheon.uf.viz.ui.menus.widgets.SubmenuContributionItem;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 12, 2009 chammack Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Mar 12, 2009 chammack Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -136,8 +137,8 @@ public class IncludeMenuItem extends CommonIncludeMenuItem implements
|
|||
|
||||
if (mtf.contributions != null) {
|
||||
for (CommonAbstractMenuContribution c : mtf.contributions) {
|
||||
AbstractMenuContributionItem<?> amc = MenuXMLMap.xmlMapping
|
||||
.get(c.getClass());
|
||||
IContribItemProvider amc = MenuXMLMap.getProvider(c
|
||||
.getClass());
|
||||
if (removalsSet.contains(c.id))
|
||||
continue;
|
||||
|
||||
|
|
|
@ -22,6 +22,14 @@ package com.raytheon.uf.viz.ui.menus.xml;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
import org.eclipse.core.runtime.IExtension;
|
||||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.IExtensionRegistry;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonAbstractMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonBundleMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonCommandContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonDynamicMenuContribution;
|
||||
|
@ -31,6 +39,9 @@ import com.raytheon.uf.common.menus.xml.CommonSeparatorMenuContribution;
|
|||
import com.raytheon.uf.common.menus.xml.CommonSubmenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonTitleContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -38,10 +49,11 @@ import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 28, 2010 mnash Initial creation
|
||||
* Jul 31, 2012 875 rferrel Added DynamicMenuContribution.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jun 28, 2010 mnash Initial creation
|
||||
* Jul 31, 2012 875 rferrel Added DynamicMenuContribution.
|
||||
* Dec 11, 2013 2602 bsteffen Load providers from extension point.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -50,9 +62,16 @@ import com.raytheon.uf.common.menus.xml.CommonToolbarSubmenuContribution;
|
|||
*/
|
||||
|
||||
public class MenuXMLMap {
|
||||
public static final Map<Class<?>, AbstractMenuContributionItem<?>> xmlMapping = new HashMap<Class<?>, AbstractMenuContributionItem<?>>();
|
||||
|
||||
static {
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DynamicMenuContribution.class);
|
||||
|
||||
private static final String EXTENSION_ID = "com.raytheon.uf.viz.ui.menus.contribItemProvider";
|
||||
|
||||
private static final Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> xmlMapping = init();
|
||||
|
||||
private static Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> init() {
|
||||
Map<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider> xmlMapping = new HashMap<Class<? extends CommonAbstractMenuContribution>, IContribItemProvider>();
|
||||
xmlMapping.put(CommonBundleMenuContribution.class,
|
||||
new BundleMenuContribution());
|
||||
xmlMapping.put(CommonCommandContribution.class,
|
||||
|
@ -70,10 +89,31 @@ public class MenuXMLMap {
|
|||
new ToolbarSubmenuContribution());
|
||||
xmlMapping.put(CommonDynamicMenuContribution.class,
|
||||
new DynamicMenuContribution());
|
||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||
IExtensionPoint point = registry.getExtensionPoint(EXTENSION_ID);
|
||||
if (point != null) {
|
||||
IExtension[] extensions = point.getExtensions();
|
||||
for (IExtension extension : extensions) {
|
||||
for (IConfigurationElement element : extension
|
||||
.getConfigurationElements()) {
|
||||
try {
|
||||
CommonAbstractMenuContribution contrib = (CommonAbstractMenuContribution) element
|
||||
.createExecutableExtension("contribution");
|
||||
IContribItemProvider provider = (IContribItemProvider) element
|
||||
.createExecutableExtension("itemProvider");
|
||||
xmlMapping.put(contrib.getClass(), provider);
|
||||
} catch (CoreException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Error preparing menu contributions.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return xmlMapping;
|
||||
}
|
||||
|
||||
public static void registerMapping(Class<?> clazz,
|
||||
AbstractMenuContributionItem<?> item) {
|
||||
xmlMapping.put(clazz, item);
|
||||
public static IContribItemProvider getProvider(
|
||||
Class<? extends CommonAbstractMenuContribution> contribClass) {
|
||||
return xmlMapping.get(contribClass);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,23 @@ import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.ui.menus.widgets.ToolbarSubmenuContributionItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution for adding submenus to a tool bar.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolbarSubmenuContribution extends
|
||||
AbstractMenuContributionItem<CommonToolbarSubmenuContribution> {
|
||||
|
||||
|
@ -52,8 +69,8 @@ public class ToolbarSubmenuContribution extends
|
|||
List<IContributionItem> contribItemList = new ArrayList<IContributionItem>();
|
||||
|
||||
for (CommonAbstractMenuContribution amc : item.contributions) {
|
||||
AbstractMenuContributionItem<?> common = MenuXMLMap.xmlMapping
|
||||
.get(amc.getClass());
|
||||
IContribItemProvider common = MenuXMLMap
|
||||
.getProvider(amc.getClass());
|
||||
contribItemList.addAll(Arrays.asList(common.getContributionItems(
|
||||
amc, subs, removals)));
|
||||
}
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Satellite Plug-in
|
||||
Bundle-Name: Satellite Visualization Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.satellite;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.satellite.Activator
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.uf.viz.core, com.raytheon.viz.ui
|
||||
Eclipse-BuddyPolicy: ext, global
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.uf.viz.core,
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.satellite;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.message;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.productbrowser;bundle-version="1.11.31",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core;bundle-version="1.12.1174",
|
||||
javax.measure,
|
||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.satellite,
|
||||
com.raytheon.uf.common.datastorage,
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.uf.common.colormap,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
com.raytheon.uf.common.message,
|
||||
com.raytheon.uf.viz.productbrowser,
|
||||
com.raytheon.uf.viz.derivparam,
|
||||
com.raytheon.uf.viz.ui.menus,
|
||||
com.raytheon.uf.common.style,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.core,
|
||||
javax.measure
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.satellite,
|
||||
com.raytheon.viz.satellite.rsc
|
||||
|
|
|
@ -48,4 +48,11 @@
|
|||
name="Satellite"
|
||||
category="com.raytheon.uf.viz.productbrowser.productbrowserpreferencespage"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.ui.menus.contribItemProvider">
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonSatBundleMenuContribution"
|
||||
itemProvider="com.raytheon.viz.satellite.menu.SatBundleMenuContribution">
|
||||
</contributionItemProvider>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.satellite;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonSatBundleMenuContribution;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.satellite.menu.SatBundleMenuContribution;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.viz.satellite";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
plugin = this;
|
||||
MenuXMLMap.registerMapping(CommonSatBundleMenuContribution.class,
|
||||
new SatBundleMenuContribution());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -58,6 +58,7 @@ import com.raytheon.uf.viz.core.localization.LocalizationConstants;
|
|||
import com.raytheon.uf.viz.core.localization.LocalizationInitializer;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
||||
import com.raytheon.uf.viz.core.procedures.ProcedureXmlManager;
|
||||
import com.raytheon.uf.viz.core.status.VizStatusHandlerFactory;
|
||||
import com.raytheon.uf.viz.personalities.cave.workbench.VizWorkbenchAdvisor;
|
||||
import com.raytheon.viz.alerts.jobs.AutoUpdater;
|
||||
|
@ -75,25 +76,29 @@ import com.raytheon.viz.core.units.UnitRegistrar;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* May 16, 2012 #636 dgilling Ensure exception is thrown
|
||||
* and CAVE immediately exits
|
||||
* if connection cannot be made to
|
||||
* localization server.
|
||||
* May 31, 2012 #674 dgilling Allow SimulatedTime to be set from
|
||||
* the command line.
|
||||
* Oct 02, 2012 #1236 dgilling Allow SimulatedTime to be set from
|
||||
* the command line even if practice
|
||||
* mode is off.
|
||||
* Jan 09, 2013 #1442 rferrel Changes to notify SimultedTime listeners.
|
||||
* Apr 17, 2013 1786 mpduff startComponent now sets StatusHandlerFactory
|
||||
* Apr 23, 2013 #1939 randerso Allow serialization to complete initialization
|
||||
* before connecting to JMS to avoid deadlock
|
||||
* May 23, 2013 #2005 njensen Shutdown on spring initialization errors
|
||||
* Oct 15, 2013 2361 njensen Added startupTimer
|
||||
* Nov 14, 2013 2361 njensen Removed initializing serialization at startup
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Apr 28, 2011 mschenke Initial creation
|
||||
* May 16, 2012 636 dgilling Ensure exception is thrown and CAVE
|
||||
* immediately exits if connection cannot be
|
||||
* made to localization server.
|
||||
* May 31, 2012 674 dgilling Allow SimulatedTime to be set from the
|
||||
* command line.
|
||||
* Oct 02, 2012 1236 dgilling Allow SimulatedTime to be set from the
|
||||
* command line even if practice mode is
|
||||
* off.
|
||||
* Jan 09, 2013 1442 rferrel Changes to notify SimultedTime listeners.
|
||||
* Apr 17, 2013 1786 mpduff startComponent now sets
|
||||
* StatusHandlerFactory
|
||||
* Apr 23, 2013 1939 randerso Allow serialization to complete
|
||||
* initialization before connecting to JMS
|
||||
* to avoid deadlock
|
||||
* May 23, 2013 2005 njensen Shutdown on spring initialization errors
|
||||
* Oct 15, 2013 2361 njensen Added startupTimer
|
||||
* Nov 14, 2013 2361 njensen Removed initializing serialization at
|
||||
* startup
|
||||
* Dec 10, 2013 2602 bsteffen Start loading ProcedureXmlManager in
|
||||
* startComponent.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -254,6 +259,8 @@ public abstract class AbstractCAVEComponent implements IStandaloneComponent {
|
|||
startInternal(componentName);
|
||||
}
|
||||
|
||||
ProcedureXmlManager.inititializeAsync();
|
||||
|
||||
if (workbenchAdvisor != null) {
|
||||
returnCode = PlatformUI.createAndRunWorkbench(display,
|
||||
workbenchAdvisor);
|
||||
|
|
|
@ -2,40 +2,44 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Volume Browser Plug-in
|
||||
Bundle-SymbolicName: com.raytheon.viz.volumebrowser;singleton:=true
|
||||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.volumebrowser.Activator
|
||||
Bundle-Version: 1.13.0.qualifier
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.ui.menus
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.viz.core,
|
||||
net.sf.swtaddons,
|
||||
com.raytheon.uf.viz.core,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.viz.pointdata,
|
||||
com.raytheon.uf.viz.d2d.core,
|
||||
com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.uf.viz.core.maps,
|
||||
com.raytheon.viz.core.graphing,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.common.localization,
|
||||
com.raytheon.uf.common.style,
|
||||
com.raytheon.uf.common.geospatial,
|
||||
com.raytheon.viz.awipstools,
|
||||
com.raytheon.uf.viz.points,
|
||||
com.raytheon.uf.viz.xy,
|
||||
com.raytheon.uf.viz.ui.menus,
|
||||
com.raytheon.uf.viz.xy.crosssection,
|
||||
com.raytheon.uf.viz.xy.timeheight,
|
||||
com.raytheon.uf.viz.xy.varheight,
|
||||
com.raytheon.viz.awipstools,
|
||||
com.raytheon.viz.grid,
|
||||
com.raytheon.uf.viz.xy.timeseries,
|
||||
com.raytheon.uf.viz.d2d.nsharp,
|
||||
gov.noaa.nws.ncep.ui.nsharp,
|
||||
com.raytheon.uf.viz.derivparam,
|
||||
com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.viz.grid,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.viz.objectiveanalysis,
|
||||
com.raytheon.viz.pointdata,
|
||||
com.raytheon.uf.common.pointdata,
|
||||
net.sf.swtaddons;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.points;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.d2d.nsharp;bundle-version="1.0.0",
|
||||
gov.noaa.nws.ncep.ui.nsharp;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core.maps;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.derivparam;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin.grid;bundle-version="1.0.0",
|
||||
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.xy;bundle-version="1.12.1174",
|
||||
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
com.raytheon.uf.common.comm
|
||||
Export-Package: com.raytheon.viz.volumebrowser,
|
||||
com.raytheon.viz.volumebrowser.datacatalog,
|
||||
com.raytheon.viz.volumebrowser.vbui,
|
||||
com.raytheon.viz.volumebrowser.xml
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.viz.core.map,
|
||||
com.raytheon.viz.core.rsc
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
</handler>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="tools" class="com.raytheon.viz.volumebrowser.ToolsAlterBundleContributor"/>
|
||||
<alterBundle class="com.raytheon.viz.volumebrowser.ToolsAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension point="com.raytheon.uf.viz.core.alterBundle">
|
||||
<alterBundle id="grids" class="com.raytheon.viz.volumebrowser.GridAlterBundleContributor"/>
|
||||
<alterBundle class="com.raytheon.viz.volumebrowser.GridAlterBundleContributor"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
|
@ -79,4 +79,19 @@
|
|||
<separator name="StdEnvDataPackageFamilies" visible="true"/>
|
||||
</menuContribution>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.ui.menus.contribItemProvider">
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonToolBarContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.ToolBarContribution">
|
||||
</contributionItemProvider>
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonMenuContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.MenuContribution">
|
||||
</contributionItemProvider>
|
||||
<contributionItemProvider
|
||||
contribution="com.raytheon.uf.common.menus.xml.CommonTitleImgContribution"
|
||||
itemProvider="com.raytheon.viz.volumebrowser.xml.TitleImgContribution">
|
||||
</contributionItemProvider>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -1,89 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.volumebrowser;
|
||||
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import com.raytheon.uf.common.menus.xml.CommonMenuContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonTitleImgContribution;
|
||||
import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.volumebrowser.xml.MenuContribution;
|
||||
import com.raytheon.viz.volumebrowser.xml.TitleImgContribution;
|
||||
import com.raytheon.viz.volumebrowser.xml.ToolBarContribution;
|
||||
|
||||
/**
|
||||
* The activator class controls the plug-in life cycle
|
||||
*/
|
||||
public class Activator extends AbstractUIPlugin {
|
||||
|
||||
// The plug-in ID
|
||||
public static final String PLUGIN_ID = "com.raytheon.viz.volumebrowser";
|
||||
|
||||
// The shared instance
|
||||
private static Activator plugin;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
*/
|
||||
public Activator() {
|
||||
plugin = this;
|
||||
MenuXMLMap.registerMapping(CommonToolBarContribution.class,
|
||||
new ToolBarContribution());
|
||||
MenuXMLMap.registerMapping(CommonMenuContribution.class,
|
||||
new MenuContribution());
|
||||
MenuXMLMap.registerMapping(CommonTitleImgContribution.class,
|
||||
new TitleImgContribution());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
|
||||
* )
|
||||
*/
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the shared instance
|
||||
*
|
||||
* @return the shared instance
|
||||
*/
|
||||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
}
|
|
@ -29,12 +29,8 @@ import com.raytheon.uf.common.dataplugin.grid.GridConstants;
|
|||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
||||
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
|
||||
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.drawables.AbstractRenderableDisplay;
|
||||
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.procedures.AlterBundleContributorAdapter;
|
||||
import com.raytheon.uf.viz.core.procedures.Bundle;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
|
||||
|
@ -55,10 +51,11 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 4, 2010 mschenke Initial creation
|
||||
* Oct 3, 2012 #1248 rferrel Change to use adapter.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 04, 2010 mschenke Initial creation
|
||||
* Oct 03, 2012 1248 rferrel Change to use adapter.
|
||||
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,8 +64,6 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
*/
|
||||
|
||||
public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(GridAlterBundleContributor.class);
|
||||
|
||||
private static final String GRID_KEY = "Grid";
|
||||
|
||||
|
@ -78,26 +73,20 @@ public class GridAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
|
||||
if (modelTitleToNameMap == null) {
|
||||
modelTitleToNameMap = new HashMap<String, String>();
|
||||
try {
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getName() != null) {
|
||||
modelTitleToNameMap.put(source.getName(),
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getName() != null) {
|
||||
modelTitleToNameMap.put(source.getName(), source.getKey());
|
||||
} else {
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info == null) {
|
||||
modelTitleToNameMap.put(source.getKey(),
|
||||
source.getKey());
|
||||
} else {
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance()
|
||||
.getInfo(source.getKey());
|
||||
if (info == null) {
|
||||
modelTitleToNameMap.put(source.getKey(),
|
||||
source.getKey());
|
||||
} else {
|
||||
modelTitleToNameMap.put(info.getTitle(),
|
||||
source.getKey());
|
||||
}
|
||||
modelTitleToNameMap.put(info.getTitle(),
|
||||
source.getKey());
|
||||
}
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Cannot load grid sources.", e);
|
||||
}
|
||||
}
|
||||
return modelTitleToNameMap;
|
||||
|
|
|
@ -49,7 +49,6 @@ import com.raytheon.uf.viz.points.PointUtilities;
|
|||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.uf.viz.points.data.IPointNode;
|
||||
import com.raytheon.uf.viz.xy.crosssection.rsc.CrossSectionResourceData;
|
||||
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.AbstractDataCatalog;
|
||||
import com.raytheon.viz.volumebrowser.datacatalog.DataCatalogManager;
|
||||
|
@ -64,12 +63,13 @@ import com.vividsolutions.jts.geom.LineString;
|
|||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Initial creation
|
||||
* Aug 08, 2012 #875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 #1248 rferrel Added listener for when points change.
|
||||
* May 03, 2013 DR14824 mgamazaychikov Added alterResource method
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- -------------- --------------------------------------
|
||||
* Aug 08, 2012 875 rferrel Generate menu entries for points.
|
||||
* Oct 03, 2012 1248 rferrel Added listener for when points change.
|
||||
* May 03, 2013 14824 mgamazaychikov Added alterResource method
|
||||
* Dec 11, 2013 2602 bsteffen Fix compiler warnings and format.
|
||||
*
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -86,9 +86,9 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
private static final String POINTS_KEY = "point";
|
||||
|
||||
private static final String LINES_KEY = "line";
|
||||
|
||||
|
||||
private static final String PLUGIN_KEY = "pluginName";
|
||||
|
||||
|
||||
private static final String REPORTYPE_KEY = "reportType";
|
||||
|
||||
private IPointChangedListener pointChangedListener;
|
||||
|
@ -255,9 +255,9 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
for (ResourcePair rp : list) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, POINTS_KEY,
|
||||
selectedString);
|
||||
alterContainer((IPointsToolContainer) rData, selectedString);
|
||||
alterResource((AbstractRequestableResourceData) rData,
|
||||
POINTS_KEY, selectedString);
|
||||
alterContainer((IPointsToolContainer) rData, selectedString);
|
||||
} else if (rData instanceof IResourceGroup) {
|
||||
alterResourceList(((IResourceGroup) rData).getResourceList(),
|
||||
selectedString);
|
||||
|
@ -265,76 +265,73 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
private void alterResource(AbstractRequestableResourceData data, String selectedKey,
|
||||
String selectedString) {
|
||||
if (selectedString == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, RequestConstraint> metadataMap = data.getMetadataMap();
|
||||
HashMap<String, RequestConstraint> metadataMapOld = new HashMap<String, RequestConstraint>();
|
||||
// make a copy of original matedata map
|
||||
metadataMapOld.putAll(metadataMap);
|
||||
// obtain data catalog
|
||||
AbstractDataCatalog ac = getDataCatalog (metadataMap);
|
||||
if ( ac == null ) {
|
||||
return;
|
||||
}
|
||||
// change the parameters in the original metadata map
|
||||
ac.alterProductParameters(selectedKey, selectedString,
|
||||
(HashMap<String, RequestConstraint>) metadataMap);
|
||||
|
||||
// in addition to metadata map resource data needs to be modified
|
||||
// for CrossSectionResourceData
|
||||
if (data instanceof CrossSectionResourceData) {
|
||||
String theKeyToChange = null;
|
||||
Iterator<Map.Entry<String, RequestConstraint>> it = metadataMap
|
||||
.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
Map.Entry<String, RequestConstraint> pairs = (Map.Entry) it
|
||||
.next();
|
||||
String currentKey = (String) pairs.getKey();
|
||||
String currentValue = metadataMap.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (metadataMapOld.containsKey(currentKey)) {
|
||||
String oldValue = metadataMapOld.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (!oldValue.equalsIgnoreCase(currentValue)) {
|
||||
theKeyToChange = currentKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
String stationID = metadataMap.get(theKeyToChange)
|
||||
.getConstraintValue();
|
||||
List<String> stationIDs = Arrays.asList(stationID
|
||||
.split("\\s*,\\s*"));
|
||||
((CrossSectionResourceData) data).setStationIDs(stationIDs);
|
||||
}
|
||||
}
|
||||
private void alterResource(AbstractRequestableResourceData data,
|
||||
String selectedKey, String selectedString) {
|
||||
if (selectedString == null) {
|
||||
return;
|
||||
}
|
||||
HashMap<String, RequestConstraint> metadataMap = data.getMetadataMap();
|
||||
HashMap<String, RequestConstraint> metadataMapOld = new HashMap<String, RequestConstraint>();
|
||||
// make a copy of original matedata map
|
||||
metadataMapOld.putAll(metadataMap);
|
||||
// obtain data catalog
|
||||
AbstractDataCatalog ac = getDataCatalog(metadataMap);
|
||||
if (ac == null) {
|
||||
return;
|
||||
}
|
||||
// change the parameters in the original metadata map
|
||||
ac.alterProductParameters(selectedKey, selectedString, metadataMap);
|
||||
|
||||
private AbstractDataCatalog getDataCatalog(
|
||||
HashMap<String, RequestConstraint> metadataMap) {
|
||||
String pluginName = null;
|
||||
String reportType = null;
|
||||
if (metadataMap.containsKey(PLUGIN_KEY)) {
|
||||
pluginName = metadataMap.get(PLUGIN_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (metadataMap.containsKey(REPORTYPE_KEY)) {
|
||||
reportType = metadataMap.get(REPORTYPE_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
String sourcesKey = pluginName + reportType;
|
||||
// in addition to metadata map resource data needs to be modified
|
||||
// for CrossSectionResourceData
|
||||
if (data instanceof CrossSectionResourceData) {
|
||||
String theKeyToChange = null;
|
||||
Iterator<Map.Entry<String, RequestConstraint>> it = metadataMap
|
||||
.entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Map.Entry<String, RequestConstraint> pairs = it.next();
|
||||
String currentKey = pairs.getKey();
|
||||
String currentValue = metadataMap.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (metadataMapOld.containsKey(currentKey)) {
|
||||
String oldValue = metadataMapOld.get(currentKey)
|
||||
.getConstraintValue();
|
||||
if (!oldValue.equalsIgnoreCase(currentValue)) {
|
||||
theKeyToChange = currentKey;
|
||||
}
|
||||
}
|
||||
}
|
||||
String stationID = metadataMap.get(theKeyToChange)
|
||||
.getConstraintValue();
|
||||
List<String> stationIDs = Arrays.asList(stationID
|
||||
.split("\\s*,\\s*"));
|
||||
((CrossSectionResourceData) data).setStationIDs(stationIDs);
|
||||
}
|
||||
}
|
||||
|
||||
SelectedData sd = new SelectedData(null, sourcesKey, null, null, null,
|
||||
null, null);
|
||||
return (AbstractDataCatalog) DataCatalogManager
|
||||
.getDataCatalogManager().getDataCatalog(sd);
|
||||
}
|
||||
private AbstractDataCatalog getDataCatalog(
|
||||
HashMap<String, RequestConstraint> metadataMap) {
|
||||
String pluginName = null;
|
||||
String reportType = null;
|
||||
if (metadataMap.containsKey(PLUGIN_KEY)) {
|
||||
pluginName = metadataMap.get(PLUGIN_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
if (metadataMap.containsKey(REPORTYPE_KEY)) {
|
||||
reportType = metadataMap.get(REPORTYPE_KEY).getConstraintValue();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
String sourcesKey = pluginName + reportType;
|
||||
|
||||
/**
|
||||
SelectedData sd = new SelectedData(null, sourcesKey, null, null, null,
|
||||
null, null);
|
||||
return (AbstractDataCatalog) DataCatalogManager.getDataCatalogManager()
|
||||
.getDataCatalog(sd);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param rData
|
||||
* @param selectedString
|
||||
*/
|
||||
|
@ -357,11 +354,11 @@ public class ToolsAlterBundleContributor extends AlterBundleContributorAdapter {
|
|||
line);
|
||||
ResourceList rl = display.getDescriptor().getResourceList();
|
||||
for (ResourcePair rp : rl) {
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData, LINES_KEY,
|
||||
line);
|
||||
}
|
||||
AbstractResourceData rData = rp.getResourceData();
|
||||
if (rData instanceof AbstractRequestableResourceData) {
|
||||
alterResource((AbstractRequestableResourceData) rData,
|
||||
LINES_KEY, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,11 +50,7 @@ import org.eclipse.swt.widgets.Label;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfo;
|
||||
import com.raytheon.uf.common.dataplugin.grid.dataset.DatasetInfoLookup;
|
||||
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.VizApp;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.points.IPointChangedListener;
|
||||
import com.raytheon.uf.viz.points.PointsDataManager;
|
||||
import com.raytheon.viz.awipstools.IToolChangedListener;
|
||||
|
@ -78,16 +74,19 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 12, 2009 #2161 lvenable Initial creation
|
||||
* Jul 31, 2012 #875 rferrel Now uses markers.
|
||||
* Sep 26, 2012 #1216 rferrel Change listener added to update
|
||||
* points menu.
|
||||
* Jan 14, 2013 #1516 rferrel Remove listeners on dispose and specify
|
||||
* Data Selection in Points Tool Action.
|
||||
* Dec 06, 2013 #2271 mpduff Save the selected plane points so the menu's are
|
||||
* recreated correctly on a pointChange action.
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* May 12, 2009 2161 lvenable Initial creation
|
||||
* Jul 31, 2012 875 rferrel Now uses markers.
|
||||
* Sep 26, 2012 1216 rferrel Change listener added to update points
|
||||
* menu.
|
||||
* Jan 14, 2013 1516 rferrel Remove listeners on dispose and specify
|
||||
* Data Selection in Points Tool Action.
|
||||
* Dec 06, 2013 2271 mpduff Save the selected plane points so the
|
||||
* menu's are recreated correctly on a
|
||||
* pointChange action.
|
||||
* Dec 11, 2013 2602 bsteffen Remove dead catch block.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -95,8 +94,6 @@ import com.raytheon.viz.volumebrowser.xml.VbSourceList;
|
|||
*/
|
||||
public class DataListsProdTableComp extends Composite implements
|
||||
IDataMenuAction {
|
||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(DataListsProdTableComp.class);
|
||||
|
||||
/**
|
||||
* Listener to update planes current point menu.
|
||||
|
@ -137,7 +134,7 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* #getMatchingProposals(java.lang.String[], java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected List getMatchingProposals(String[] proposals,
|
||||
protected List<?> getMatchingProposals(String[] proposals,
|
||||
String contents) {
|
||||
return super.getMatchingProposals(
|
||||
getMatches(proposals, contents), "");
|
||||
|
@ -671,82 +668,76 @@ public class DataListsProdTableComp extends Composite implements
|
|||
* items/menus.
|
||||
*/
|
||||
|
||||
try {
|
||||
// Linked HashMap used to preserve the ordering of categories
|
||||
Map<String, List<IContributionItem>> catMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
Map<String, Map<String, List<IContributionItem>>> subCatMap = new LinkedHashMap<String, Map<String, List<IContributionItem>>>();
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getViews() != null
|
||||
&& !source.getViews().contains(setting)) {
|
||||
continue;
|
||||
}
|
||||
List<IContributionItem> catList = null;
|
||||
if (source.getSubCategory() != null) {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap
|
||||
.get(source.getCategory());
|
||||
if (subMap == null) {
|
||||
subMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
subCatMap.put(source.getCategory(), subMap);
|
||||
}
|
||||
catList = subMap.get(source.getSubCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
subMap.put(source.getSubCategory(), catList);
|
||||
}
|
||||
} else {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
}
|
||||
MenuContribution mContrib = new MenuContribution();
|
||||
mContrib.xml.key = source.getKey();
|
||||
if (source.getName() != null) {
|
||||
mContrib.xml.menuText = source.getName();
|
||||
} else {
|
||||
// Attempt a lookup in the grib model table
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info != null) {
|
||||
mContrib.xml.menuText = info.getTitle();
|
||||
} else {
|
||||
mContrib.xml.menuText = source.getKey();
|
||||
}
|
||||
}
|
||||
catList.add(new MenuContributionItem(mContrib));
|
||||
// Linked HashMap used to preserve the ordering of categories
|
||||
Map<String, List<IContributionItem>> catMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
Map<String, Map<String, List<IContributionItem>>> subCatMap = new LinkedHashMap<String, Map<String, List<IContributionItem>>>();
|
||||
for (VbSource source : VbSourceList.getInstance().getEntries()) {
|
||||
if (source.getViews() != null
|
||||
&& !source.getViews().contains(setting)) {
|
||||
continue;
|
||||
}
|
||||
for (Entry<String, List<IContributionItem>> entry : catMap
|
||||
.entrySet()) {
|
||||
ToolBarContribution tbContrib = new ToolBarContribution();
|
||||
tbContrib.xml.toolItemText = entry.getKey();
|
||||
tbContrib.xml.id = setting.toString() + entry.getKey();
|
||||
List<IContributionItem> catList = null;
|
||||
if (source.getSubCategory() != null) {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap
|
||||
.get(entry.getKey());
|
||||
if (subMap != null) {
|
||||
for (Entry<String, List<IContributionItem>> subEntry : subMap
|
||||
.entrySet()) {
|
||||
TitleImgContribution tContrib = new TitleImgContribution();
|
||||
tContrib.xml.titleText = subEntry.getKey();
|
||||
tContrib.xml.displayDashes = true;
|
||||
tContrib.xml.displayImage = true;
|
||||
entry.getValue().add(
|
||||
new TitleImgContributionItem(tContrib));
|
||||
entry.getValue().addAll(subEntry.getValue());
|
||||
}
|
||||
.get(source.getCategory());
|
||||
if (subMap == null) {
|
||||
subMap = new LinkedHashMap<String, List<IContributionItem>>();
|
||||
subCatMap.put(source.getCategory(), subMap);
|
||||
}
|
||||
catList = subMap.get(source.getSubCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
subMap.put(source.getSubCategory(), catList);
|
||||
}
|
||||
} else {
|
||||
catList = catMap.get(source.getCategory());
|
||||
if (catList == null) {
|
||||
catList = new ArrayList<IContributionItem>();
|
||||
catMap.put(source.getCategory(), catList);
|
||||
}
|
||||
sourceControl.toolbar.add(new ToolBarContributionItem(
|
||||
tbContrib, entry.getValue().toArray(
|
||||
new IContributionItem[0])));
|
||||
|
||||
}
|
||||
} catch (VizException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
MenuContribution mContrib = new MenuContribution();
|
||||
mContrib.xml.key = source.getKey();
|
||||
if (source.getName() != null) {
|
||||
mContrib.xml.menuText = source.getName();
|
||||
} else {
|
||||
// Attempt a lookup in the grib model table
|
||||
DatasetInfo info = DatasetInfoLookup.getInstance().getInfo(
|
||||
source.getKey());
|
||||
if (info != null) {
|
||||
mContrib.xml.menuText = info.getTitle();
|
||||
} else {
|
||||
mContrib.xml.menuText = source.getKey();
|
||||
}
|
||||
}
|
||||
catList.add(new MenuContributionItem(mContrib));
|
||||
}
|
||||
for (Entry<String, List<IContributionItem>> entry : catMap.entrySet()) {
|
||||
ToolBarContribution tbContrib = new ToolBarContribution();
|
||||
tbContrib.xml.toolItemText = entry.getKey();
|
||||
tbContrib.xml.id = setting.toString() + entry.getKey();
|
||||
Map<String, List<IContributionItem>> subMap = subCatMap.get(entry
|
||||
.getKey());
|
||||
if (subMap != null) {
|
||||
for (Entry<String, List<IContributionItem>> subEntry : subMap
|
||||
.entrySet()) {
|
||||
TitleImgContribution tContrib = new TitleImgContribution();
|
||||
tContrib.xml.titleText = subEntry.getKey();
|
||||
tContrib.xml.displayDashes = true;
|
||||
tContrib.xml.displayImage = true;
|
||||
entry.getValue()
|
||||
.add(new TitleImgContributionItem(tContrib));
|
||||
entry.getValue().addAll(subEntry.getValue());
|
||||
}
|
||||
}
|
||||
sourceControl.toolbar.add(new ToolBarContributionItem(tbContrib,
|
||||
entry.getValue().toArray(new IContributionItem[0])));
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -39,6 +39,23 @@ import com.raytheon.viz.volumebrowser.xml.TitleImgContribution;
|
|||
import com.raytheon.viz.volumebrowser.xml.ToolBarContribution;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution item for tool bar buttons.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Set the id of menu items.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unkown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolBarContributionItem extends ContributionItem {
|
||||
|
||||
protected Menu menu;
|
||||
|
@ -116,6 +133,7 @@ public class ToolBarContributionItem extends ContributionItem {
|
|||
GeoUtil.formatCoordinate(new Coordinate(i, i))
|
||||
.split(" ")[coordinateIndex]);
|
||||
menuContribution.xml.key = keyPrefixString + i;
|
||||
menuContribution.xml.id = idPrefixString + i;
|
||||
|
||||
MenuContributionItem menuContributionItem = new MenuContributionItem(
|
||||
menuContribution);
|
||||
|
|
|
@ -31,9 +31,27 @@ import com.raytheon.uf.common.menus.xml.CommonToolBarContribution;
|
|||
import com.raytheon.uf.common.menus.xml.VariableSubstitution;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.AbstractMenuContributionItem;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.IContribItemProvider;
|
||||
import com.raytheon.uf.viz.ui.menus.xml.MenuXMLMap;
|
||||
import com.raytheon.viz.volumebrowser.widget.ToolBarContributionItem;
|
||||
|
||||
/**
|
||||
*
|
||||
* Contribution Item for tool bars.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Dec 11, 2013 2602 bsteffen Update MenuXMLMap.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author unknown
|
||||
* @version 1.0
|
||||
*/
|
||||
public class ToolBarContribution extends
|
||||
AbstractMenuContributionItem<CommonToolBarContribution> {
|
||||
|
||||
|
@ -49,8 +67,8 @@ public class ToolBarContribution extends
|
|||
List<IContributionItem> contribItemList = new ArrayList<IContributionItem>();
|
||||
|
||||
for (CommonAbstractMenuContribution amc : item.contributions) {
|
||||
AbstractMenuContributionItem<?> common = MenuXMLMap.xmlMapping
|
||||
.get(amc.getClass());
|
||||
IContribItemProvider common = MenuXMLMap
|
||||
.getProvider(amc.getClass());
|
||||
contribItemList.addAll(Arrays.asList(common.getContributionItems(
|
||||
amc, subs, removals)));
|
||||
}
|
||||
|
|
|
@ -6,28 +6,29 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
* Description of a single source for the volume browser.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2011 bsteffen Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 06, 2011 bsteffen Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
* @see VbSourceList
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class VbSource implements ISerializableObject {
|
||||
public class VbSource {
|
||||
|
||||
@XmlAttribute(required = true)
|
||||
private String key;
|
||||
|
|
|
@ -12,20 +12,19 @@ import com.raytheon.uf.common.localization.FileUpdatedMessage;
|
|||
import com.raytheon.uf.common.localization.ILocalizationFileObserver;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO Add Description
|
||||
* List of sources for populating the volume browser tool bar menus
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 6, 2011 bsteffen Initial creation
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------- -------- ----------- -----------------------------------------
|
||||
* Jan 06, 2011 bsteffen Initial creation
|
||||
* Dec 11, 2013 2602 bsteffen Remove ISerializableObject.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -34,7 +33,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement
|
||||
public class VbSourceList implements ISerializableObject {
|
||||
public class VbSourceList {
|
||||
|
||||
private final static String VB_SOURCE_FILE = "volumebrowser/VbSources.xml";
|
||||
|
||||
|
@ -78,7 +77,7 @@ public class VbSourceList implements ISerializableObject {
|
|||
this.entries = entries;
|
||||
}
|
||||
|
||||
public static VbSourceList getInstance() throws VizException {
|
||||
public static VbSourceList getInstance() {
|
||||
synchronized (VB_SOURCE_FILE) {
|
||||
if (instance == null) {
|
||||
LocalizationFile file = PathManagerFactory.getPathManager()
|
||||
|
|
Loading…
Add table
Reference in a new issue