directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r524461 - in /directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor: dialogs/ACIItemDialog.java widgets/ACIItemVisualEditorComposite.java
Date Sat, 31 Mar 2007 17:54:25 GMT
Author: seelmann
Date: Sat Mar 31 10:54:23 2007
New Revision: 524461

URL: http://svn.apache.org/viewvc?view=rev&rev=524461
Log:
Added "Check Syntax" button

Modified:
    directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/dialogs/ACIItemDialog.java
    directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/widgets/ACIItemVisualEditorComposite.java

Modified: directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/dialogs/ACIItemDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/dialogs/ACIItemDialog.java?view=diff&rev=524461&r1=524460&r2=524461
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/dialogs/ACIItemDialog.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/dialogs/ACIItemDialog.java
Sat Mar 31 10:54:23 2007
@@ -31,6 +31,7 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.Region;
 import org.eclipse.swt.SWT;
@@ -104,6 +105,7 @@
     {
         Composite composite = ( Composite ) super.createButtonBar( parent );
         super.createButton( composite, 987654321, "Format", false );
+        super.createButton( composite, 876543210, "Check Syntax", false );
         return composite;
     }
     
@@ -117,6 +119,22 @@
         if ( buttonId == 987654321 )
         {
             tabFolderComposite.format();
+        }
+        if ( buttonId == 876543210 )
+        {
+            try
+            {
+                tabFolderComposite.getInput();
+                //MessageDialog.openInformation( getShell(), "Check", input ); //$NON-NLS-1$
+                MessageDialog.openInformation( getShell(), "Syntax ok", "Syntax ok" ); //$NON-NLS-1$
+            }
+            catch ( ParseException pe )
+            {
+                //MessageDialog.openError( getShell(), "Syntax Error", e1.getMessage() );
//$NON-NLS-1$
+                IStatus status = new Status( IStatus.ERROR, Activator.PLUGIN_ID, 1, Messages
+                    .getString( "ACIItemDialog.error.invalidSyntax" ), pe ); //$NON-NLS-1$
+                ErrorDialog.openError( getShell(), Messages.getString( "ACIItemDialog.error.title"
), null, status ); //$NON-NLS-1$
+            }
         }
 
         // call super implementation

Modified: directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/widgets/ACIItemVisualEditorComposite.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/widgets/ACIItemVisualEditorComposite.java?view=diff&rev=524461&r1=524460&r2=524461
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/widgets/ACIItemVisualEditorComposite.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-aciitemeditor/src/main/java/org/apache/directory/ldapstudio/aciitemeditor/widgets/ACIItemVisualEditorComposite.java
Sat Mar 31 10:54:23 2007
@@ -29,14 +29,10 @@
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
 import org.apache.directory.shared.ldap.aci.ItemFirstACIItem;
 import org.apache.directory.shared.ldap.aci.UserFirstACIItem;
-import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 
 
@@ -108,26 +104,6 @@
         composite = new Composite( this, SWT.NONE );
         composite.setLayout( gridLayout );
         composite.setLayoutData( gridData );
-
-        // test button
-        // TODO: remove
-        Button testButton = new Button( composite, SWT.NONE );
-        testButton.setText( " C H E C K " ); //$NON-NLS-1$
-        testButton.addSelectionListener( new SelectionAdapter()
-        {
-            public void widgetSelected( SelectionEvent e )
-            {
-                try
-                {
-                    String input = getInput();
-                    MessageDialog.openInformation( getShell(), "Check", input ); //$NON-NLS-1$
-                }
-                catch ( ParseException e1 )
-                {
-                    MessageDialog.openError( getShell(), "Check Error", e1.getMessage() );
//$NON-NLS-1$
-                }
-            }
-        } );
 
         generalComposite = new ACIItemGeneralComposite( composite, SWT.NONE );
         generalComposite.addWidgetModifyListener( this );



Mime
View raw message