Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 167565 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/wsdm/tooling/editor/mrt/internal/MrtPrototypeForm.java (-1 / +60 lines)
Lines 65-71 Link Here
65
import org.eclipse.tptp.wsdm.tooling.validation.builders.internal.GatherErrors;
65
import org.eclipse.tptp.wsdm.tooling.validation.builders.internal.GatherErrors;
66
import org.eclipse.tptp.wsdm.tooling.validation.mrt.internal.MrtDefinitionValidator;
66
import org.eclipse.tptp.wsdm.tooling.validation.mrt.internal.MrtDefinitionValidator;
67
import org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard;
67
import org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard;
68
import org.eclipse.tptp.wsdm.tooling.wizard.mrt.internal.MRTCodeGenerationDelegate;
69
import org.eclipse.tptp.wsdm.tooling.wizard.mrt.internal.NewProjectWizard;
68
import org.eclipse.tptp.wsdm.tooling.wizard.mrt.internal.WorkspaceCapSelector;
70
import org.eclipse.tptp.wsdm.tooling.wizard.mrt.internal.WorkspaceCapSelector;
71
import org.eclipse.ui.IFileEditorInput;
69
import org.eclipse.ui.IWorkbenchPage;
72
import org.eclipse.ui.IWorkbenchPage;
70
import org.eclipse.ui.PartInitException;
73
import org.eclipse.ui.PartInitException;
71
import org.eclipse.ui.PlatformUI;
74
import org.eclipse.ui.PlatformUI;
Lines 148-153 Link Here
148
151
149
	private Composite _newCapabilitySection;
152
	private Composite _newCapabilitySection;
150
153
154
	private Composite _CodeGenerationSection;
155
151
	private Label _errorLabel;
156
	private Label _errorLabel;
152
157
153
	/**
158
	/**
Lines 352-368 Link Here
352
		initMrtWidgets();
357
		initMrtWidgets();
353
		// Initialice new capability related widgets
358
		// Initialice new capability related widgets
354
		initNewCapWidgets();
359
		initNewCapWidgets();
360
		initCodeGenWidget();
355
	}
361
	}
356
362
357
	/**
363
	/**
358
	 * Initialize all the sections.
364
	 * Initialize all the sections.
359
	 */
365
	 */
360
	private void initSections() {
366
	private void initSections() {
361
		_mrtSection = createSection(Messages.MEP_TYPE, "");
367
		_mrtSection = createSection(Messages.MEP_TYPE, "",1,2);
362
368
363
		_newCapabilitySection = createSection(Messages.NEW_CUSTOM_CAP,
369
		_newCapabilitySection = createSection(Messages.NEW_CUSTOM_CAP,
364
				Messages.NEW_CUSTOM_CAP_CREATE);
370
				Messages.NEW_CUSTOM_CAP_CREATE);
365
371
372
		_CodeGenerationSection = createSection(Messages.MRT_CODE_GEN,Messages.MRT_CODE_GEN_TEXT);
373
366
	}
374
	}
367
375
368
	/**
376
	/**
Lines 520-525 Link Here
520
		toolkit.paintBordersFor(_newCapabilitySection);
528
		toolkit.paintBordersFor(_newCapabilitySection);
521
	}
529
	}
522
530
531
	private void initCodeGenWidget() {
532
		GridLayout layout = new GridLayout();
533
		_CodeGenerationSection.setLayout(layout);
534
		
535
		FormToolkit toolkit = getToolkit();
536
537
		// Composite to held link
538
		Composite codeGenComposite = toolkit
539
				.createComposite(_CodeGenerationSection);
540
		layout = new GridLayout();
541
		codeGenComposite.setLayout(layout);
542
		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
543
		gd.horizontalSpan = 1;
544
		codeGenComposite.setLayoutData(gd);
545
546
		// Hyperlink group
547
		Shell shell = getForm().getShell();
548
		HyperlinkGroup codeGenGroup = createHyperlinkGroup(shell);
549
550
		// Create listener to handle code generation link
551
		IHyperlinkListener codeGenLinkListener = new IHyperlinkListener() {
552
			public void linkEntered(HyperlinkEvent event) {
553
			}
554
555
			public void linkExited(HyperlinkEvent event) {
556
			}
557
558
			public void linkActivated(HyperlinkEvent event) {
559
				IFile mrtFile = ((IFileEditorInput) _editor.getEditorInput()).getFile();
560
				MRTCodeGenerationDelegate mrtCodeGen = new MRTCodeGenerationDelegate(mrtFile);
561
				NewProjectWizard newprjw = new NewProjectWizard(mrtCodeGen);
562
				WizardDialog wd = new WizardDialog(getForm().getShell(), newprjw);
563
				wd.create();
564
				newprjw.setWindowTitle(Messages.NEW_CUSTOM_CAP);
565
				newprjw.addPages();
566
				wd.open();
567
			}
568
		};
569
570
		// Create Code Generation Link
571
		Image capEditorImage = EclipseUtils.loadImage(getForm().getShell()
572
				.getDisplay(), "icons/capability.gif");
573
		Hyperlink codeGenLink = createLink(codeGenComposite,
574
				"Code Generation", codeGenLinkListener,
575
				capEditorImage);
576
		codeGenGroup.add(codeGenLink);
577
578
		toolkit.paintBordersFor(_CodeGenerationSection);
579
		
580
	}
581
523
	// Method to create hyperlinkgroup
582
	// Method to create hyperlinkgroup
524
	private HyperlinkGroup createHyperlinkGroup(Shell shell) {
583
	private HyperlinkGroup createHyperlinkGroup(Shell shell) {
525
		HyperlinkGroup group = new HyperlinkGroup(shell.getDisplay());
584
		HyperlinkGroup group = new HyperlinkGroup(shell.getDisplay());
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java (-1 / +3 lines)
Lines 119-125 Link Here
119
	   public static String MRT_ERROR_CANNOT_LOAD_RES;
119
	   public static String MRT_ERROR_CANNOT_LOAD_RES;
120
	   public static String MRT_ERROR_CANNOT_SERIALIZE;
120
	   public static String MRT_ERROR_CANNOT_SERIALIZE;
121
	   public static String MRT_MAY_NOT_WORK_WITH_MAX;
121
	   public static String MRT_MAY_NOT_WORK_WITH_MAX;
122
	   
122
	   public static String MRT_CODE_GEN;
123
	   public static String MRT_CODE_GEN_TEXT;
124
123
	   static {
125
	   static {
124
	      NLS.initializeMessages(BUNDLE_NAME, Messages.class);
126
	      NLS.initializeMessages(BUNDLE_NAME, Messages.class);
125
	   }
127
	   }
(-)src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties (+3 lines)
Lines 110-112 Link Here
110
MRT_ERROR_CANNOT_SERIALIZE = IWAT0674E Could not serialize Manageable Resource Type !
110
MRT_ERROR_CANNOT_SERIALIZE = IWAT0674E Could not serialize Manageable Resource Type !
111
PROJECT_EXISTS_WARNING = The project already exists
111
PROJECT_EXISTS_WARNING = The project already exists
112
MRT_MAY_NOT_WORK_WITH_MAX = The Manageable Resource Type may not function as expected with Managed Agent Explorer if \"{0}\" is not included !
112
MRT_MAY_NOT_WORK_WITH_MAX = The Manageable Resource Type may not function as expected with Managed Agent Explorer if \"{0}\" is not included !
113
MRT_CODE_GEN = Code Generation
114
MRT_CODE_GEN_TEXT = You can generate code after the creation of the MRT
115

Return to bug 167565