diff options
author | Vincent Lorenzo | 2016-12-14 22:31:31 +0000 |
---|---|---|
committer | Vincent Lorenzo | 2016-12-14 22:31:31 +0000 |
commit | fa17679ff018be5f9f1edb6094a823a40b20be95 (patch) | |
tree | 0a8160b70c590445bdb32545ebfa7b78ef0781bd /extraplugins | |
parent | 5a7bef184c48fd7ffaefe6f8b6d990903bebf2ad (diff) | |
download | org.eclipse.papyrus-fa17679ff018be5f9f1edb6094a823a40b20be95.tar.gz org.eclipse.papyrus-fa17679ff018be5f9f1edb6094a823a40b20be95.tar.xz org.eclipse.papyrus-fa17679ff018be5f9f1edb6094a823a40b20be95.zip |
Bug 496176: [Importer][Rhapsody] Papyrus must provide a tool to import Rhapsody SysML Model into Papyrus. Externalize some strings and improve a dialog.
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'extraplugins')
3 files changed, 14 insertions, 7 deletions
diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/Messages.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/Messages.java index 7a10e7679fb..c1ea901abd6 100755 --- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/Messages.java +++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/Messages.java @@ -27,6 +27,9 @@ public class Messages extends NLS { public static String ImportRhapsodyPreferencesPage_Locatio; public static String RhapsodyShareFolderUtils_PapyrusRhapsodyImporter_DialogMessage; public static String RhapsodyShareFolderUtils_PapyrusRhapsodyImporter_DialogTitle; + public static String RhapsodyShareFolderUtils_Retry; + public static String RhapsodyShareFolderUtils_TheGivenFolderIsNotNamed; + public static String RhapsodyShareFolderUtils_TheGivenPathIsNotTheGoodOne; public static String ImportRhapsodyPreferencesPage_SelectTheLocation_DialogMessage; public static String ImportRhapsodyPreferencesPage_SelectTheShareRhapsodyFolder; public static String ImportRhapsodyPreferencesPage_Worskspace; diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/messages.properties b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/messages.properties index b33745f4a8f..3081c0ad4b5 100755 --- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/messages.properties +++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/messages/messages.properties @@ -3,6 +3,9 @@ ImportRhapsodyPreferencesPage_Information=Rhapsody installation comes with a fol ImportRhapsodyPreferencesPage_Locatio=Location: RhapsodyShareFolderUtils_PapyrusRhapsodyImporter_DialogMessage=Select Rhapsody "Share" Folder RhapsodyShareFolderUtils_PapyrusRhapsodyImporter_DialogTitle=Papyrus Rhapsody Importer +RhapsodyShareFolderUtils_Retry=Retry +RhapsodyShareFolderUtils_TheGivenFolderIsNotNamed=The given folder is not named "{0}". +RhapsodyShareFolderUtils_TheGivenPathIsNotTheGoodOne=The given path is not the good one. ImportRhapsodyPreferencesPage_SelectTheLocation_DialogMessage=Select the location of the Rhapsody folder called "Share". ImportRhapsodyPreferencesPage_SelectTheShareRhapsodyFolder=Select the shared Rhapsody folder ImportRhapsodyPreferencesPage_Worskspace=Workspace... diff --git a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/utils/RhapsodyShareFolderUtils.java b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/utils/RhapsodyShareFolderUtils.java index 7a5f17df381..b8717032b0e 100755 --- a/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/utils/RhapsodyShareFolderUtils.java +++ b/extraplugins/migration/rhapsody/org.eclipse.papyrus.migration.rhapsody/src/org/eclipse/papyrus/migration/rhapsody/utils/RhapsodyShareFolderUtils.java @@ -21,10 +21,10 @@ import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; +import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osgi.util.NLS; import org.eclipse.papyrus.migration.rhapsody.Activator; -import org.eclipse.papyrus.migration.rhapsody.importer.utils.RpyProjectHandler; import org.eclipse.papyrus.migration.rhapsody.messages.Messages; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; @@ -41,7 +41,7 @@ public class RhapsodyShareFolderUtils { private static final String SELECT_FOLDER_MESSAGE = Messages.RhapsodyShareFolderUtils_PapyrusRhapsodyImporter_DialogMessage; - private static final String MESSAGE = "The given path is not the good one. Retry (Yes)/ Cancel (No)"; + private static final String MESSAGE = Messages.RhapsodyShareFolderUtils_TheGivenPathIsNotTheGoodOne; /** The name of the tested files and folders allowing to decide if the given path is the Rhapsody Share folder */ private static final String SHARE = "Share";//$NON-NLS-1$ @@ -78,7 +78,7 @@ public class RhapsodyShareFolderUtils { */ public static final void registerRhapsodySharedFolderFromEclipseInitIfRequired() { final ScopedPreferenceStore prefStore = (ScopedPreferenceStore) Activator.getDefault().getPreferenceStore(); - prefStore.setDefault(RHAPSODY_HOME_VARIABLE_NAME, ""); + prefStore.setDefault(RHAPSODY_HOME_VARIABLE_NAME, ""); //$NON-NLS-1$ final String prefValue = prefStore.getString(RHAPSODY_HOME_VARIABLE_NAME); if (null == prefValue || prefValue.isEmpty()) { final String propertyValue = System.getProperty(RHAPSODY_HOME_VARIABLE_NAME); @@ -100,7 +100,7 @@ public class RhapsodyShareFolderUtils { public static final boolean checkRhapsodyShareFolderAndAskForItWhenRequired() { boolean finalResult = null != RhapsodyShareFolderUtils.getRhapsodyShareFolder(); if (!finalResult) { - final String result = browseFileSystemForRhapsodyShareFolder(Display.getDefault().getActiveShell(), ""); + final String result = browseFileSystemForRhapsodyShareFolder(Display.getDefault().getActiveShell(), ""); //$NON-NLS-1$ if (null != result && !result.isEmpty()) { boolean isOk = isARhapsodySharedFolder(result).isOK(); if (isOk) { @@ -109,8 +109,9 @@ public class RhapsodyShareFolderUtils { } } if (!finalResult) { - boolean res = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), SELECT_FOLDER_TITLE, MESSAGE); - if (res) { + final MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(), SELECT_FOLDER_TITLE, null, MESSAGE, MessageDialog.QUESTION, 0, new String[] { Messages.RhapsodyShareFolderUtils_Retry, IDialogConstants.CANCEL_LABEL }); + int res = dialog.open(); + if (IDialogConstants.OK_ID==res) { finalResult = checkRhapsodyShareFolderAndAskForItWhenRequired(); } } @@ -195,7 +196,7 @@ public class RhapsodyShareFolderUtils { status = createFolderErrorStatusFor(path, false); } } else { - status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind("The given folder is not named \"{0}\".", SHARE)); + status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, NLS.bind(Messages.RhapsodyShareFolderUtils_TheGivenFolderIsNotNamed, SHARE)); } return status; } |