Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 58640 Details for
Bug 167565
UCD: MRT: Create a link in the MRT view to launch code generation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for creating a link for CodeGeneration in MRT
Patch_167565.txt (text/plain), 7.44 KB, created by
Nalini V
on 2007-02-09 04:59:47 EST
(
hide
)
Description:
Patch for creating a link for CodeGeneration in MRT
Filename:
MIME Type:
Creator:
Nalini V
Created:
2007-02-09 04:59:47 EST
Size:
7.44 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.wsdm.editor >Index: src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java,v >retrieving revision 1.1 >diff -u -r1.1 Messages.java >--- src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java 8 Feb 2007 19:40:13 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/Messages.java 9 Feb 2007 09:48:20 -0000 >@@ -123,6 +123,9 @@ > public static String CODE_GEN_PROJECT_DIR; > public static String CODE_GEN_LOCATION_ERROR; > public static String CODE_GEN_DIR_LOCATION; >+ public static String MRT_CODE_GEN; >+ public static String MRT_CODE_GEN_TEXT; >+ > > static > { >Index: src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties,v >retrieving revision 1.1 >diff -u -r1.1 messages.properties >--- src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties 8 Feb 2007 19:40:13 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/nls/messages/mrt/internal/messages.properties 9 Feb 2007 09:48:20 -0000 >@@ -118,3 +118,7 @@ > CODE_GEN_PROJECT_DIR = Project contents directory must be specified > CODE_GEN_LOCATION_ERROR = Invalid location path > CODE_GEN_DIR_LOCATION = Select the location directory. >+MRT_CODE_GEN = Code Generation >+MRT_CODE_GEN_TEXT = You can generate code after the creation of the MRT >+ >+ >Index: src/org/eclipse/tptp/wsdm/tooling/editor/mrt/internal/MrtPrototypeForm.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/editor/mrt/internal/MrtPrototypeForm.java,v >retrieving revision 1.1 >diff -u -r1.1 MrtPrototypeForm.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/mrt/internal/MrtPrototypeForm.java 8 Feb 2007 19:40:11 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/mrt/internal/MrtPrototypeForm.java 9 Feb 2007 09:48:20 -0000 >@@ -14,6 +14,7 @@ > > import java.util.Arrays; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.edit.domain.EditingDomain; > import org.eclipse.jface.action.Action; >@@ -39,6 +40,8 @@ > import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; >+import org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal.MRTCodeGenerationDelegate; >+import org.eclipse.tptp.wsdm.tooling.codegen.mrt.internal.NewProjectWizard; > import org.eclipse.tptp.wsdm.tooling.editor.internal.Category; > import org.eclipse.tptp.wsdm.tooling.model.capabilities.Capability; > import org.eclipse.tptp.wsdm.tooling.model.manageableResourceType.ManageableResourceType; >@@ -47,6 +50,7 @@ > import org.eclipse.tptp.wsdm.tooling.util.internal.MrtUtils; > import org.eclipse.tptp.wsdm.tooling.wizard.capability.internal.NewCapabilityWizard; > import org.eclipse.tptp.wsdm.tooling.wizard.mrt.internal.CapabilitySelectionDialog; >+import org.eclipse.ui.IFileEditorInput; > import org.eclipse.ui.IPropertyListener; > import org.eclipse.ui.forms.HyperlinkGroup; > import org.eclipse.ui.forms.events.HyperlinkEvent; >@@ -108,26 +112,20 @@ > > protected Capability _selectedCapForDelete; > >+ private Composite _CodeGenerationSection; >+ > /** > * Creates the Manageable Resource Type Definition page to implement > * specified capabilities > * >- * @param parent - >- * UI Composite to be used >- * @param formTitle - >- * Title of the page >- * @param editingDomain - >- * Handle to the context of the editor >- * @param mrt - >- * Manageable Resource Type definition >- * @param allCapsPassed - >- * All capabilities from workspace >- * @param mrtCaps1 - >- * Capabilities implemented by the manageable resource type >- * @param containerName - >- * Containing project for the manageable resource type >- * @param editor - >- * Handle to the editor >+ * @param parent - UI Composite to be used >+ * @param formTitle - Title of the page >+ * @param editingDomain - Handle to the context of the editor >+ * @param mrt - Manageable Resource Type definition >+ * @param allCapsPassed - All capabilities from workspace >+ * @param mrtCaps1 - Capabilities implemented by the manageable resource type >+ * @param containerName - Containing project for the manageable resource type >+ * @param editor - Handle to the editor > */ > public MrtPrototypeForm(Composite parent, String formTitle, > EditingDomain editingDomain, MrtEditor editor) >@@ -202,6 +200,7 @@ > initMrtWidgets(); > // Initialice new capability related widgets > initNewCapWidgets(); >+ initCodeGenWidget(); > } > > /** >@@ -209,11 +208,13 @@ > */ > private void initSections() > { >- _mrtSection = createSection(Messages.MEP_TYPE, ""); >- >+ //_mrtSection = createSection(Messages.MEP_TYPE, ""); >+ _mrtSection = createSection(Messages.MEP_TYPE, "",1,2); >+ > _newCapabilitySection = createSection(Messages.NEW_CUSTOM_CAP, > Messages.NEW_CUSTOM_CAP_CREATE); > >+ _CodeGenerationSection = createSection(Messages.MRT_CODE_GEN,Messages.MRT_CODE_GEN_TEXT); > } > > /** >@@ -376,6 +377,55 @@ > toolkit.paintBordersFor(_newCapabilitySection); > } > >+ private void initCodeGenWidget() { >+ GridLayout layout = new GridLayout(); >+ _CodeGenerationSection.setLayout(layout); >+ >+ FormToolkit toolkit = getToolkit(); >+ >+ // Composite to held link >+ Composite codeGenComposite = toolkit >+ .createComposite(_CodeGenerationSection); >+ layout = new GridLayout(); >+ codeGenComposite.setLayout(layout); >+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING); >+ gd.horizontalSpan = 1; >+ codeGenComposite.setLayoutData(gd); >+ >+ // Hyperlink group >+ Shell shell = getForm().getShell(); >+ HyperlinkGroup codeGenGroup = createHyperlinkGroup(shell); >+ >+ // Create listener to handle code generation link >+ IHyperlinkListener codeGenLinkListener = new IHyperlinkListener() { >+ public void linkEntered(HyperlinkEvent event) { >+ } >+ >+ public void linkExited(HyperlinkEvent event) { >+ } >+ >+ public void linkActivated(HyperlinkEvent event) { >+ IFile mrtFile = ((IFileEditorInput) _editor.getEditorInput()).getFile(); >+ MRTCodeGenerationDelegate mrtCodeGen = new MRTCodeGenerationDelegate(mrtFile); >+ NewProjectWizard newprjw = new NewProjectWizard(mrtCodeGen); >+ WizardDialog wd = new WizardDialog(getForm().getShell(), newprjw); >+ newprjw.setWindowTitle(Messages.MRT_CODE_GEN); >+ wd.open(); >+ } >+ }; >+ >+ // Create Code Generation Link >+ Image capEditorImage = EclipseUtils.loadImage(getForm().getShell() >+ .getDisplay(), "icons/capability.gif"); >+ Hyperlink codeGenLink = createLink(codeGenComposite, >+ "Code Generation", codeGenLinkListener, >+ capEditorImage); >+ codeGenGroup.add(codeGenLink); >+ >+ toolkit.paintBordersFor(_CodeGenerationSection); >+ >+ } >+ > // Method to create hyperlinkgroup > private HyperlinkGroup createHyperlinkGroup(Shell shell) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 167565
:
57002
|
57011
| 58640