directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1208447 - in /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions: DeleteSchemaElementAction.java messages.properties messages_de.properties messages_fr.properties
Date Wed, 30 Nov 2011 14:19:19 GMT
Author: pamarcelot
Date: Wed Nov 30 14:19:17 2011
New Revision: 1208447

URL: http://svn.apache.org/viewvc?rev=1208447&view=rev
Log:
Switched to 'MessageDialog' class instead of 'MessageBox' class for user confirmation.

Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/DeleteSchemaElementAction.java
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_de.properties
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_fr.properties

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/DeleteSchemaElementAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/DeleteSchemaElementAction.java?rev=1208447&r1=1208446&r2=1208447&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/DeleteSchemaElementAction.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/DeleteSchemaElementAction.java
Wed Nov 30 14:19:17 2011
@@ -39,17 +39,15 @@ import org.apache.directory.studio.schem
 import org.apache.directory.studio.schemaeditor.view.wrappers.SchemaWrapper;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -121,38 +119,41 @@ public class DeleteSchemaElementAction e
 
         if ( !selection.isEmpty() )
         {
-            MessageBox messageBox = new MessageBox( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
-                SWT.YES | SWT.NO | SWT.ICON_QUESTION );
+            StringBuilder message = new StringBuilder();
+
             int count = selection.size();
+
             if ( count == 1 )
             {
                 Object firstElement = selection.getFirstElement();
                 if ( firstElement instanceof AttributeTypeWrapper )
                 {
-                    messageBox.setMessage( Messages.getString( "DeleteSchemaElementAction.SureToDeleteAttributeType"
) ); //$NON-NLS-1$
+                    message.append( Messages.getString( "DeleteSchemaElementAction.SureDeleteAttributeType"
) ); //$NON-NLS-1$
                 }
                 else if ( firstElement instanceof ObjectClassWrapper )
                 {
-                    messageBox.setMessage( Messages.getString( "DeleteSchemaElementAction.SureToDeleteObjectClass"
) ); //$NON-NLS-1$
+                    message.append( Messages.getString( "DeleteSchemaElementAction.SureDeleteObjectClass"
) ); //$NON-NLS-1$
                 }
                 else if ( firstElement instanceof SchemaWrapper )
                 {
-                    messageBox.setMessage( Messages.getString( "DeleteSchemaElementAction.SureToDeleteSchema"
) ); //$NON-NLS-1$
+                    message.append( Messages.getString( "DeleteSchemaElementAction.SureDeleteSchema"
) ); //$NON-NLS-1$
                 }
                 else
                 {
-                    messageBox.setMessage( Messages.getString( "DeleteSchemaElementAction.SureToDeleteItem"
) ); //$NON-NLS-1$
+                    message.append( Messages.getString( "DeleteSchemaElementAction.SureDeleteItem"
) ); //$NON-NLS-1$
                 }
 
             }
             else
             {
-                messageBox.setMessage( NLS.bind(
-                    Messages.getString( "DeleteSchemaElementAction.SureToDeleteItems" ),
new Object[] { count } ) ); //$NON-NLS-1$
+                message.append( NLS.bind(
+                    Messages.getString( "DeleteSchemaElementAction.SureDeleteItems" ), new
Object[] { count } ) ); //$NON-NLS-1$
             }
-            if ( messageBox.open() == SWT.YES )
-            {
 
+            // Showing the confirmation window
+            if ( MessageDialog.openConfirm( viewer.getControl().getShell(),
+                Messages.getString( "DeleteSchemaElementAction.DeleteTitle" ), message.toString()
) ) //$NON-NLS-1$
+            {
                 Map<String, Schema> schemasMap = new HashMap<String, Schema>();
                 List<SchemaObject> schemaObjectsList = new ArrayList<SchemaObject>();
 

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages.properties?rev=1208447&r1=1208446&r2=1208447&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages.properties
Wed Nov 30 14:19:17 2011
@@ -29,11 +29,12 @@ DeleteProjectAction.SureDeleteFollowingP
 DeleteProjectAction.SureDeleteSelectedProjects=Are you sure to delete the selected projects?
 DeleteSchemaElementAction.DeleteAction=&Delete
 DeleteSchemaElementAction.DeleteToolTip=Delete
-DeleteSchemaElementAction.SureToDeleteAttributeType=Are you sure you want to delete this
attribute type?
-DeleteSchemaElementAction.SureToDeleteItem=Are you sure you want to delete this item?
-DeleteSchemaElementAction.SureToDeleteItems=Are you sure you want to delete these {0} items?
-DeleteSchemaElementAction.SureToDeleteObjectClass=Are you sure you want to delete this object
class?
-DeleteSchemaElementAction.SureToDeleteSchema=Are you sure you want to delete this schema?
+DeleteSchemaElementAction.DeleteTitle=Delete
+DeleteSchemaElementAction.SureDeleteAttributeType=Are you sure you want to delete this attribute
type?
+DeleteSchemaElementAction.SureDeleteItem=Are you sure you want to delete this item?
+DeleteSchemaElementAction.SureDeleteItems=Are you sure you want to delete these {0} items?
+DeleteSchemaElementAction.SureDeleteObjectClass=Are you sure you want to delete this object
class?
+DeleteSchemaElementAction.SureDeleteSchema=Are you sure you want to delete this schema?
 ExportProjectsAction.SchemaProjectsAction=Schema Projects
 ExportSchemasAsOpenLdapAction.SchemaAsOpenLDAPFilesAction=Schemas as OpenLDAP files
 ExportSchemasAsXmlAction.SchemaAsXMLFileAction=Schemas as XML file(s)

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_de.properties?rev=1208447&r1=1208446&r2=1208447&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_de.properties
Wed Nov 30 14:19:17 2011
@@ -29,11 +29,12 @@ DeleteProjectAction.SureDeleteFollowingP
 DeleteProjectAction.SureDeleteSelectedProjects=Wollen Sie die ausgew\u00E4hlten Projekte
wirklich l\u00F6schen?
 DeleteSchemaElementAction.DeleteAction=&L\u00F6schen
 DeleteSchemaElementAction.DeleteToolTip=L\u00F6schen
-DeleteSchemaElementAction.SureToDeleteAttributeType=Wollen Sie diesen Attribut Typ wirklich
l\u00F6schen?
-DeleteSchemaElementAction.SureToDeleteItem=Wollen Sie dieses Element wirklich l\u00F6schen?
-DeleteSchemaElementAction.SureToDeleteItems=Wollen Sie diese Elemente {0} wirklich l\u00F6schen?
-DeleteSchemaElementAction.SureToDeleteObjectClass=Wollen Sie diese Objektklasse wirklich
l\u00F6schen?
-DeleteSchemaElementAction.SureToDeleteSchema=Wollen Sie diese Schema wirklich l\u00F6schen?
+DeleteSchemaElementAction.DeleteTitle=L\u00F6schen
+DeleteSchemaElementAction.SureDeleteAttributeType=Wollen Sie diesen Attribut Typ wirklich
l\u00F6schen?
+DeleteSchemaElementAction.SureDeleteItem=Wollen Sie dieses Element wirklich l\u00F6schen?
+DeleteSchemaElementAction.SureDeleteItems=Wollen Sie diese Elemente {0} wirklich l\u00F6schen?
+DeleteSchemaElementAction.SureDeleteObjectClass=Wollen Sie diese Objektklasse wirklich l\u00F6schen?
+DeleteSchemaElementAction.SureDeleteSchema=Wollen Sie diese Schema wirklich l\u00F6schen?
 ExportProjectsAction.SchemaProjectsAction=Schema Projekte
 ExportSchemasAsOpenLdapAction.SchemaAsOpenLDAPFilesAction=Schemas im OpenLDAP Format
 ExportSchemasAsXmlAction.SchemaAsXMLFileAction=Schemas als XML Datei(en)

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_fr.properties?rev=1208447&r1=1208446&r2=1208447&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/controller/actions/messages_fr.properties
Wed Nov 30 14:19:17 2011
@@ -29,11 +29,12 @@ DeleteProjectAction.SureDeleteFollowingP
 DeleteProjectAction.SureDeleteSelectedProjects=Etes-vous s\u00FBr de vouloir supprimer les
projets s\u00E9lectionn\u00E9s ?
 DeleteSchemaElementAction.DeleteAction=&Supprimer
 DeleteSchemaElementAction.DeleteToolTip=Supprime
-DeleteSchemaElementAction.SureToDeleteAttributeType=Etes-vous s\u00FBr de vouloir supprimer
ce type d'attribut?
-DeleteSchemaElementAction.SureToDeleteItem=Etes-vous s\u00FBr de vouloir supprimer cet \u00E9l\u00E9ment
?
-DeleteSchemaElementAction.SureToDeleteItems=Etes-vous s\u00FBr de vouloir supprimer ces {0}
\u00E9l\u00E9ments?
-DeleteSchemaElementAction.SureToDeleteObjectClass=Etes-vous s\u00FBr de vouloir supprimer
cette classe d'objet?
-DeleteSchemaElementAction.SureToDeleteSchema=Etes-vous s\u00FBr de vouloir supprimer ce sch\u00E9ma?
+DeleteSchemaElementAction.DeleteTitle=Supprimer
+DeleteSchemaElementAction.SureDeleteAttributeType=Etes-vous s\u00FBr de vouloir supprimer
ce type d'attribut?
+DeleteSchemaElementAction.SureDeleteItem=Etes-vous s\u00FBr de vouloir supprimer cet \u00E9l\u00E9ment
?
+DeleteSchemaElementAction.SureDeleteItems=Etes-vous s\u00FBr de vouloir supprimer ces {0}
\u00E9l\u00E9ments?
+DeleteSchemaElementAction.SureDeleteObjectClass=Etes-vous s\u00FBr de vouloir supprimer cette
classe d'objet?
+DeleteSchemaElementAction.SureDeleteSchema=Etes-vous s\u00FBr de vouloir supprimer ce sch\u00E9ma?
 ExportProjectsAction.SchemaProjectsAction=Projets de sch\u00E9ma
 ExportSchemasAsOpenLdapAction.SchemaAsOpenLDAPFilesAction=Sch\u00E9ma(s) au format OpenLDAP
 ExportSchemasAsXmlAction.SchemaAsXMLFileAction=Sch\u00E9ma(s) au format XML



Mime
View raw message