소스 검색

Added Yakindu Professional Link to Domain Wizard Page
#515

Andreas Muelder 9 년 전
부모
커밋
cdee0c090c

+ 2 - 1
plugins/org.yakindu.sct.ui.editor/build.properties

@@ -4,5 +4,6 @@ bin.includes = META-INF/,\
                .,\
                plugin.xml,\
                icons/,\
-               templates/
+               templates/,\
+               images/
 src.includes = icons/

+ 2 - 0
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/StatechartImages.java

@@ -24,6 +24,8 @@ public enum StatechartImages {
 
 	LOGO("icons/obj16/logo-16.png"),
 	
+	PRO_EDITION("images/pro.png"),
+	
 	MENU("icons/obj16/Menu-16.png");
 	
 

+ 5 - 7
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/wizards/CreationWizard.java

@@ -102,13 +102,11 @@ public class CreationWizard extends Wizard implements INewWizard {
 		modelCreationPage.setTitle("YAKINDU SCT Diagram");
 		modelCreationPage.setDescription("Create a new YAKINDU SCT Diagram File");
 		modelCreationPage.setImageDescriptor(StatechartImages.LOGO.imageDescriptor());
-		if (DomainRegistry.getDomainDescriptors().size() > 1) {
-			domainWizardPage = new DomainWizardPage("DomainWizard");
-			domainWizardPage.setTitle("Select Statechart Domain");
-			domainWizardPage.setDescription("Select the domain you want to create a statechart for.");
-			domainWizardPage.setImageDescriptor(StatechartImages.LOGO.imageDescriptor());
-			addPage(domainWizardPage);
-		}
+		domainWizardPage = new DomainWizardPage("DomainWizard");
+		domainWizardPage.setTitle("Select Statechart Domain");
+		domainWizardPage.setDescription("Select the domain you want to create a statechart for.");
+		domainWizardPage.setImageDescriptor(StatechartImages.LOGO.imageDescriptor());
+		addPage(domainWizardPage);
 
 		addPage(modelCreationPage);
 	}

+ 16 - 14
plugins/org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/wizards/DomainWizardPage.java

@@ -21,15 +21,17 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.program.Program;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
 import org.yakindu.base.base.BasePackage;
 import org.yakindu.sct.domain.extension.DomainRegistry;
 import org.yakindu.sct.domain.extension.IDomainDescriptor;
+import org.yakindu.sct.ui.editor.StatechartImages;
 
 /**
  * 
@@ -74,9 +76,6 @@ public class DomainWizardPage extends WizardPage {
 		});
 		domainCombo.setInput(DomainRegistry.getDomainDescriptors());
 
-		Label spacer2 = new Label(domainSelectionGroup, SWT.NONE);
-		GridDataFactory.fillDefaults().span(2, 1).applyTo(spacer2);
-
 		description = new Label(domainSelectionGroup, SWT.WRAP);
 		GridDataFactory.fillDefaults().grab(true, false).span(2, 1).applyTo(description);
 		setControl(composite);
@@ -94,14 +93,17 @@ public class DomainWizardPage extends WizardPage {
 		domainCombo.setSelection(new StructuredSelection(DomainRegistry
 				.getDomainDescriptor(BasePackage.Literals.DOMAIN_ELEMENT__DOMAIN_ID.getDefaultValueLiteral())));
 
-		Link sctLink = new Link(composite, SWT.NONE);
-		sctLink.setText("<a>Get additional Statechart Domain Extensions</a>");
-		sctLink.addSelectionListener(new SelectionListener() {
-			public void widgetSelected(SelectionEvent e) {
-				org.eclipse.swt.program.Program.launch("http://statecharts.org/");
-			}
-
-			public void widgetDefaultSelected(SelectionEvent e) {
+		Label spacer2 = new Label(domainSelectionGroup, SWT.NONE);
+		GridDataFactory.fillDefaults().span(2, 1).applyTo(spacer2);
+		
+		Label image = new Label(composite, SWT.NONE);
+		GridDataFactory.fillDefaults().grab(false, false).align(GridData.CENTER, GridData.CENTER).span(2, 1)
+				.applyTo(image);
+		image.setImage(StatechartImages.PRO_EDITION.image());
+		image.addMouseListener(new MouseAdapter() {
+			@Override
+			public void mouseDown(MouseEvent e) {
+				Program.launch("http://statecharts.org/pro.html");
 			}
 		});
 	}