Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2014-07-02 13:53:20 +0000
committerMarkus Tiede2014-07-02 13:53:20 +0000
commitb9766f6b3fb071164ff7143fce09c400f3bffb35 (patch)
tree3ca9e3a041828c6a2981ab3fd0d86c8776f7f9c9 /org.eclipse.jubula.toolkit.common
parente6f767a99c9c618996df0c52ed506b4d7fbac3ce (diff)
downloadorg.eclipse.jubula.core-b9766f6b3fb071164ff7143fce09c400f3bffb35.tar.gz
org.eclipse.jubula.core-b9766f6b3fb071164ff7143fce09c400f3bffb35.tar.xz
org.eclipse.jubula.core-b9766f6b3fb071164ff7143fce09c400f3bffb35.zip
Non-sprint task - minor refactoring + POC for toolkit hierarchy viewer added.
Diffstat (limited to 'org.eclipse.jubula.toolkit.common')
-rw-r--r--org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/businessprocess/ToolkitSupportBP.java24
-rw-r--r--org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/utils/ToolkitUtils.java14
-rw-r--r--org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/xml/businessprocess/ComponentBuilder.java22
3 files changed, 30 insertions, 30 deletions
diff --git a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/businessprocess/ToolkitSupportBP.java b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/businessprocess/ToolkitSupportBP.java
index e68e187dc..03c46e18f 100644
--- a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/businessprocess/ToolkitSupportBP.java
+++ b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/businessprocess/ToolkitSupportBP.java
@@ -17,7 +17,7 @@ import org.eclipse.jubula.toolkit.common.IToolKitProvider;
import org.eclipse.jubula.toolkit.common.exception.ToolkitPluginException;
import org.eclipse.jubula.toolkit.common.i18n.Messages;
import org.eclipse.jubula.tools.constants.StringConstants;
-import org.eclipse.jubula.tools.xml.businessmodell.ToolkitPluginDescriptor;
+import org.eclipse.jubula.tools.xml.businessmodell.ToolkitDescriptor;
import org.eclipse.swt.widgets.Composite;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -33,9 +33,9 @@ public class ToolkitSupportBP {
private static Logger log = LoggerFactory.getLogger(ToolkitSupportBP.class);
/** Map of {@link IToolKitProvider} */
- private static Map<ToolkitPluginDescriptor, IToolKitProvider>
+ private static Map<ToolkitDescriptor, IToolKitProvider>
toolkitProvider =
- new HashMap<ToolkitPluginDescriptor, IToolKitProvider>();
+ new HashMap<ToolkitDescriptor, IToolKitProvider>();
/**
* Utility Constructor.
@@ -89,7 +89,7 @@ public class ToolkitSupportBP {
public static String getToolkitLevel(String toolkitName)
throws ToolkitPluginException {
- ToolkitPluginDescriptor descr = getToolkitDescriptor(toolkitName);
+ ToolkitDescriptor descr = getToolkitDescriptor(toolkitName);
return descr.getLevel();
}
@@ -107,7 +107,7 @@ public class ToolkitSupportBP {
log.error(msg);
throwToolkitPluginException(msg, null);
}
- final ToolkitPluginDescriptor descr = getToolkitDescriptor(name);
+ final ToolkitDescriptor descr = getToolkitDescriptor(name);
return toolkitProvider.get(descr);
}
@@ -126,7 +126,7 @@ public class ToolkitSupportBP {
log.error(msg);
throwToolkitPluginException(msg, null);
}
- final ToolkitPluginDescriptor descr = getToolkitDescriptor(name);
+ final ToolkitDescriptor descr = getToolkitDescriptor(name);
final String superId = descr.getIncludes();
final IToolKitProvider superToolkitProv = getToolkitProvider(superId);
return toolkitProvider.get(superToolkitProv);
@@ -135,10 +135,10 @@ public class ToolkitSupportBP {
/**
*
* @param toolkitId the id of the toolkit
- * @return the {@link ToolkitPluginDescriptor} of the toolkit with the
+ * @return the {@link ToolkitDescriptor} of the toolkit with the
* given id.
*/
- public static ToolkitPluginDescriptor getToolkitDescriptor(
+ public static ToolkitDescriptor getToolkitDescriptor(
String toolkitId) throws ToolkitPluginException {
if (toolkitId == null) {
@@ -147,7 +147,7 @@ public class ToolkitSupportBP {
log.error(msg);
throwToolkitPluginException(msg, null);
}
- for (ToolkitPluginDescriptor descr : toolkitProvider.keySet()) {
+ for (ToolkitDescriptor descr : toolkitProvider.keySet()) {
if (toolkitId.equals(descr.getToolkitID())) {
return descr;
}
@@ -162,11 +162,11 @@ public class ToolkitSupportBP {
/**
* Adds a new {@link IToolKitProvider} with the dependent
- * {@link ToolkitPluginDescriptor} as key.
- * @param descr a ToolkitPluginDescriptor (key)
+ * {@link ToolkitDescriptor} as key.
+ * @param descr a ToolkitDescriptor (key)
* @param provider a IToolKitProvider (value)
*/
- public static void addToolkitProvider(ToolkitPluginDescriptor descr,
+ public static void addToolkitProvider(ToolkitDescriptor descr,
IToolKitProvider provider) {
toolkitProvider.put(descr, provider);
diff --git a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/utils/ToolkitUtils.java b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/utils/ToolkitUtils.java
index 7d6a04bca..1aefe63c4 100644
--- a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/utils/ToolkitUtils.java
+++ b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/utils/ToolkitUtils.java
@@ -26,7 +26,7 @@ import org.eclipse.jubula.toolkit.common.xml.businessprocess.ComponentBuilder;
import org.eclipse.jubula.tools.constants.StringConstants;
import org.eclipse.jubula.tools.constants.ToolkitConstants;
import org.eclipse.jubula.tools.xml.businessmodell.CompSystem;
-import org.eclipse.jubula.tools.xml.businessmodell.ToolkitPluginDescriptor;
+import org.eclipse.jubula.tools.xml.businessmodell.ToolkitDescriptor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Composite;
import org.slf4j.Logger;
@@ -118,10 +118,10 @@ public class ToolkitUtils {
* name was found.
*/
public static String getToolkitName(String toolkitId) {
- final List<ToolkitPluginDescriptor> toolkitPluginDescriptors =
+ final List<ToolkitDescriptor> toolkitPluginDescriptors =
ComponentBuilder.getInstance().getCompSystem()
- .getAllToolkitPluginDescriptors();
- for (ToolkitPluginDescriptor desc : toolkitPluginDescriptors) {
+ .getAllToolkitDescriptors();
+ for (ToolkitDescriptor desc : toolkitPluginDescriptors) {
if (desc.getToolkitID().equalsIgnoreCase(toolkitId)) {
return desc.getName();
}
@@ -142,8 +142,8 @@ public class ToolkitUtils {
CompSystem compSys = ComponentBuilder.getInstance().getCompSystem();
- ToolkitPluginDescriptor desc =
- compSys.getToolkitPluginDescriptor(toolkitId);
+ ToolkitDescriptor desc =
+ compSys.getToolkitDescriptor(toolkitId);
String includes = desc.getIncludes();
@@ -154,7 +154,7 @@ public class ToolkitUtils {
while (desc != null && includes != null
&& !ToolkitConstants.EMPTY_EXTPOINT_ENTRY.equals(includes)) {
- desc = compSys.getToolkitPluginDescriptor(includes);
+ desc = compSys.getToolkitDescriptor(includes);
if (desc != null) {
includes = desc.getIncludes();
if (includes != null && includes.equals(includedToolkitId)) {
diff --git a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/xml/businessprocess/ComponentBuilder.java b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/xml/businessprocess/ComponentBuilder.java
index 84ae16b11..c11ad6640 100644
--- a/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/xml/businessprocess/ComponentBuilder.java
+++ b/org.eclipse.jubula.toolkit.common/src/org/eclipse/jubula/toolkit/common/xml/businessprocess/ComponentBuilder.java
@@ -33,7 +33,7 @@ import org.eclipse.jubula.tools.i18n.CompSystemI18n;
import org.eclipse.jubula.tools.messagehandling.MessageIDs;
import org.eclipse.jubula.tools.utils.generator.AbstractComponentBuilder;
import org.eclipse.jubula.tools.xml.businessmodell.CompSystem;
-import org.eclipse.jubula.tools.xml.businessmodell.ToolkitPluginDescriptor;
+import org.eclipse.jubula.tools.xml.businessmodell.ToolkitDescriptor;
import org.eclipse.jubula.tools.xml.businessprocess.ConfigVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -83,7 +83,7 @@ public class ComponentBuilder extends AbstractComponentBuilder {
InputStream inputStream = getInputStream(
componentConfigurationURL);
CompSystem compSystem = createCompSystem(inputStream);
- ToolkitPluginDescriptor descr =
+ ToolkitDescriptor descr =
createToolkitDescriptor(element, compSystem);
final ResourceBundle resourceBundle = provider
.getI18nResourceBundle();
@@ -113,22 +113,22 @@ public class ComponentBuilder extends AbstractComponentBuilder {
}
/**
- * Creates a {@link ToolkitPluginDescriptor} which hold the attributes
+ * Creates a {@link ToolkitDescriptor} which hold the attributes
* of the Toolkit and adds the Descriptor to the given CompSystem.
* @param element an IConfigurationElement
* @param compSystem the CompSystem
- * @return {@link ToolkitPluginDescriptor}
+ * @return {@link ToolkitDescriptor}
* Constants.ATTR_<attribute_name>
* @throws ToolkitPluginException if an error occurs
*/
- private ToolkitPluginDescriptor createToolkitDescriptor(
+ private ToolkitDescriptor createToolkitDescriptor(
IConfigurationElement element, CompSystem compSystem)
throws ToolkitPluginException {
final String toolkitId = element.getAttribute(
ToolkitConstants.ATTR_TOOLKITID);
try {
- if (compSystem.getToolkitPluginDescriptor(toolkitId) == null) {
+ if (compSystem.getToolkitDescriptor(toolkitId) == null) {
final String name = element.getAttribute(
ToolkitConstants.ATTR_NAME);
@@ -146,8 +146,8 @@ public class ComponentBuilder extends AbstractComponentBuilder {
.getConfigVersion();
final int majorVersion = configVersion.getMajorVersion();
final int minorVersion = configVersion.getMinorVersion();
- final ToolkitPluginDescriptor descr =
- new ToolkitPluginDescriptor(toolkitId, name,
+ final ToolkitDescriptor descr =
+ new ToolkitDescriptor(toolkitId, name,
includes, depends, level, order, isUserToolkit,
majorVersion, minorVersion);
compSystem.addToolkitPluginDescriptor(toolkitId, descr);
@@ -206,12 +206,12 @@ public class ComponentBuilder extends AbstractComponentBuilder {
* an concrete.
*/
public List<String> getLevelToolkitIds() {
- List<ToolkitPluginDescriptor> toolkitDescriptors = super
- .getCompSystem().getIndependentToolkitPluginDescriptors(true);
+ List<ToolkitDescriptor> toolkitDescriptors = super
+ .getCompSystem().getIndependentToolkitDescriptors(true);
List<String> toolkitIds = new ArrayList<String>();
- for (ToolkitPluginDescriptor desc : toolkitDescriptors) {
+ for (ToolkitDescriptor desc : toolkitDescriptors) {
toolkitIds.add(desc.getToolkitID());
}

Back to the top