Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java33
1 files changed, 29 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
index 77c3110976..6d92a8a5c5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UrlRenderer.java
@@ -14,10 +14,14 @@ package org.eclipse.osee.framework.ui.skynet.render;
import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.ContentUrl;
import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.GENERALIZED_EDIT;
import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.GENERAL_REQUESTED;
-import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.PRODUCE_ATTRIBUTE;
+import java.util.List;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.types.IArtifact;
+import org.eclipse.osee.framework.ui.swt.Displays;
+import org.eclipse.swt.program.Program;
/**
* @author Ryan D. Brooks
@@ -30,12 +34,33 @@ public class UrlRenderer extends DefaultArtifactRenderer {
}
@Override
+ public String getName() {
+ return "UrlRenderer";
+ }
+
+ @Override
public int getApplicabilityRating(PresentationType presentationType, IArtifact artifact, Object... objects) throws OseeCoreException {
Artifact aArtifact = artifact.getFullArtifact();
- if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED,
- PRODUCE_ATTRIBUTE) && aArtifact.isAttributeTypeValid(ContentUrl)) {
- return SUBTYPE_TYPE_MATCH;
+ if (!presentationType.matches(GENERALIZED_EDIT, GENERAL_REQUESTED) && aArtifact.isAttributeTypeValid(
+ ContentUrl)) {
+ return ARTIFACT_TYPE_MATCH;
}
return NO_MATCH;
}
+
+ @Override
+ public void open(final List<Artifact> artifacts, PresentationType presentationType) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ for (Artifact artifact : artifacts) {
+ Program.launch(artifact.getSoleAttributeValueAsString(ContentUrl, getName()));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(UrlRenderer.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+ });
+ }
} \ No newline at end of file

Back to the top