Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2011-05-19 08:57:12 +0000
committervlorenzo2011-05-19 08:57:12 +0000
commit0b331248045a4dfabde05fcc2f53a21b3e48fa90 (patch)
tree6ef7fc0645f527a3ce7d3a36695dd9944c9f04a4 /incoming
parenta26c28e81eec612a1d2f037651e387856a5a4d2f (diff)
downloadorg.eclipse.papyrus-0b331248045a4dfabde05fcc2f53a21b3e48fa90.tar.gz
org.eclipse.papyrus-0b331248045a4dfabde05fcc2f53a21b3e48fa90.tar.xz
org.eclipse.papyrus-0b331248045a4dfabde05fcc2f53a21b3e48fa90.zip
NEW - bug 335332: [Property View] Papyrus shall provide an extensible property view runtime
https://bugs.eclipse.org/bugs/show_bug.cgi?id=335332 C. Letavernier Contribution
Diffstat (limited to 'incoming')
-rw-r--r--incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java3
-rw-r--r--incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java10
-rw-r--r--incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties5
-rw-r--r--incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java11
-rw-r--r--incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java3
5 files changed, 12 insertions, 20 deletions
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java
index 76f5aa8258d..2dca619aac6 100644
--- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java
+++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/editor/UIEditor.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;
import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -196,7 +197,7 @@ public class UIEditor extends EcoreEditor implements ITabbedPropertySheetPageCon
if(CustomizationPreferencePage.askForConfirmation()) {
int defaultIndex = CustomizationPreferencePage.openCustomizationPerspective() ? 0 : 1;
- MessageDialog confirmationDialog = new MessageDialog(getContainer().getShell(), Messages.UIEditor_ChangePerspective, null, Messages.UIEditor_ChangePerspectiveMessage, MessageDialog.QUESTION, new String[]{ Messages.UIEditor_Yes, Messages.UIEditor_No }, defaultIndex);
+ MessageDialog confirmationDialog = new MessageDialog(getContainer().getShell(), Messages.UIEditor_ChangePerspective, null, Messages.UIEditor_ChangePerspectiveMessage, MessageDialog.QUESTION, new String[]{ IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, defaultIndex);
confirmationDialog.open();
openPerspective = confirmationDialog.getReturnCode() == 0;
} else {
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java
index 1963377510b..a4ff17bcbbf 100644
--- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java
+++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/Messages.java
@@ -25,8 +25,6 @@ public class Messages extends NLS {
public static String CopyContextAction_To;
- public static String CustomizationDialog_cancel;
-
public static String CustomizationDialog_cannotDeletePluginContext;
public static String CustomizationDialog_configurationName;
@@ -57,16 +55,12 @@ public class Messages extends NLS {
public static String CustomizationDialog_enterConfigurationName;
- public static String CustomizationDialog_no;
-
public static String CustomizationDialog_plugin;
public static String CustomizationDialog_removeSelectedContext;
public static String CustomizationDialog_selectContextToEdit;
- public static String CustomizationDialog_yes;
-
public static String CustomizationPreferencePage_AskForConfirmation;
public static String CustomizationPreferencePage_OpenCustomizationPerspective;
@@ -84,15 +78,13 @@ public class Messages extends NLS {
public static String Preview_previewIsDisabled;
public static String Preview_Unnamed;
+
public static String UIEditor_ChangePerspective;
public static String UIEditor_ChangePerspectiveMessage;
public static String UIEditor_FilterViews;
- public static String UIEditor_No;
-
- public static String UIEditor_Yes;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties
index bfca077d831..0610a712d78 100644
--- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties
+++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/messages/messages.properties
@@ -2,7 +2,6 @@ CopyContextAction_Copying=Copying
CopyContextAction_InitializingTheCopyOf=Initializing the copy of
CopyContextAction_ThisMayTakeSomeTime=. This may take some time
CopyContextAction_To=\ to
-CustomizationDialog_cancel=Cancel
CustomizationDialog_cannotDeletePluginContext=Plugin contexts cannot be deleted
CustomizationDialog_configurationName=Configuration name
CustomizationDialog_configurationNameNotEmpty=The name of the configuration shouldn't be empty
@@ -18,11 +17,9 @@ CustomizationDialog_deleteContextConfirmation2=\ ? This choice is irreversible.
CustomizationDialog_edit=Edit
CustomizationDialog_editSelectedContext=Edits the selected Context. This option is only available for non-plugin Contexts
CustomizationDialog_enterConfigurationName=Enter the new configuration name
-CustomizationDialog_no=No
CustomizationDialog_plugin=\ (Plugin)
CustomizationDialog_removeSelectedContext=Removes the selected Context. This option is only available for non-plugin Contexts
CustomizationDialog_selectContextToEdit=Select a context to edit. Plugin contexts should be copied before they can be edited.
-CustomizationDialog_yes=Yes
CustomizationPreferencePage_AskForConfirmation=Ask for confirmation
CustomizationPreferencePage_OpenCustomizationPerspective=Open customization perspective
CustomizationPreferencePage_PropertyViewCustomizationPreferences=Property view customization preferences
@@ -35,5 +32,3 @@ Preview_Unnamed=<<Unnamed>>
UIEditor_ChangePerspective=Change perspective ?
UIEditor_ChangePerspectiveMessage=This editor is associated to the Customization perspective. Do you want to open this perspective now ?
UIEditor_FilterViews=Filter views :
-UIEditor_No=No
-UIEditor_Yes=Yes
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java
index 2fb9777b253..3550081727d 100644
--- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java
+++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CopyContextAction.java
@@ -87,8 +87,9 @@ public class CopyContextAction {
targetContext.setName(targetName);
targetContext.eResource().save(Collections.EMPTY_MAP);
ConfigurationManager.instance.addContext(targetContext, activate);
- if(activate)
- ConfigurationManager.instance.disableContext(source);
+ if(activate) {
+ ConfigurationManager.instance.disableContext(source, true);
+ }
return targetContext;
} else {
return null;
@@ -130,8 +131,9 @@ public class CopyContextAction {
//Copy of the dependent resources which are located in the same folder
//(or subfolders)
for(Resource resource : source.eResource().getResourceSet().getResources()) {
- if(monitor.isCanceled())
+ if(monitor.isCanceled()) {
return;
+ }
if(source.eResource() != resource && isRelative(source, resource)) {
copy(resource, targetDirectory, source, targetName);
}
@@ -182,8 +184,9 @@ public class CopyContextAction {
//Strict copy : we read directly the file, instead of interpreting it as a Model
private void copy(InputStream source, File target) throws IOException {
- if(!target.getParentFile().exists())
+ if(!target.getParentFile().exists()) {
target.getParentFile().mkdirs();
+ }
FileWriter out = new FileWriter(target);
try {
diff --git a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java
index 8a40545edc8..5bf8ac951d1 100644
--- a/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java
+++ b/incoming/org.eclipse.papyrus.properties.customization/src/org/eclipse/papyrus/properties/customization/ui/CustomizationDialog.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.properties.customization.ui;
import java.io.IOException;
import java.util.Collection;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.dialogs.TrayDialog;
@@ -228,7 +229,7 @@ public class CustomizationDialog extends TrayDialog implements SelectionListener
return;
}
- MessageDialog dialog = new MessageDialog(getShell(), Messages.CustomizationDialog_deleteContext, null, Messages.CustomizationDialog_deleteContextConfirmation1 + sourceContext.getName() + Messages.CustomizationDialog_deleteContextConfirmation2, MessageDialog.CONFIRM, new String[]{ Messages.CustomizationDialog_yes, Messages.CustomizationDialog_no, Messages.CustomizationDialog_cancel }, 2);
+ MessageDialog dialog = new MessageDialog(getShell(), Messages.CustomizationDialog_deleteContext, null, Messages.CustomizationDialog_deleteContextConfirmation1 + sourceContext.getName() + Messages.CustomizationDialog_deleteContextConfirmation2, MessageDialog.CONFIRM, new String[]{ IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 2);
int result = dialog.open();
if(result == 0) { //0 is "Yes" (It is *not* the same 0 as Window.OK)
action.removeContext(sourceContext);

Back to the top