directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1151820 - /directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java
Date Thu, 28 Jul 2011 12:40:56 GMT
Author: pamarcelot
Date: Thu Jul 28 12:40:55 2011
New Revision: 1151820

URL: http://svn.apache.org/viewvc?rev=1151820&view=rev
Log:
Better organization for extra buttons (they now appears at the left of the 'Cancel' and 'OK'
buttons).

Modified:
    directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java

Modified: directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java?rev=1151820&r1=1151819&r2=1151820&view=diff
==============================================================================
--- directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java
(original)
+++ directory/studio/trunk/plugins/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/dialogs/ACIItemDialog.java
Thu Jul 28 12:40:55 2011
@@ -46,6 +46,8 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class ACIItemDialog extends Dialog
 {
+    private static final int FORMAT_BUTTON = 987654321;
+    private static final int CHECK_SYNTAX_BUTTON = 876543210;
 
     /** The context containing the initial value, passed by the constructor */
     private ACIItemValueWithContext context;
@@ -92,16 +94,14 @@ public class ACIItemDialog extends Dialo
 
 
     /**
-     * {@inheritDoc}
-     * 
-     * This implementation additionally adds the Format button.
+     * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
      */
-    protected Control createButtonBar( Composite parent )
+    protected void createButtonsForButtonBar( Composite parent )
     {
-        Composite composite = ( Composite ) super.createButtonBar( parent );
-        super.createButton( composite, 987654321, Messages.getString( "ACIItemDialog.button.format"
), false ); //$NON-NLS-1$
-        super.createButton( composite, 876543210, Messages.getString( "ACIItemDialog.button.checkSyntax"
), false ); //$NON-NLS-1$
-        return composite;
+        createButton( parent, FORMAT_BUTTON, Messages.getString( "ACIItemDialog.button.format"
), false ); //$NON-NLS-1$
+        createButton( parent, CHECK_SYNTAX_BUTTON, Messages.getString( "ACIItemDialog.button.checkSyntax"
), false ); //$NON-NLS-1$
+        createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false );
+        createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL,
false );
     }
 
 
@@ -112,11 +112,11 @@ public class ACIItemDialog extends Dialo
      */
     protected void buttonPressed( int buttonId )
     {
-        if ( buttonId == 987654321 )
+        if ( buttonId == FORMAT_BUTTON )
         {
             tabFolderComposite.format();
         }
-        if ( buttonId == 876543210 )
+        if ( buttonId == CHECK_SYNTAX_BUTTON )
         {
             try
             {



Mime
View raw message