You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2007/01/16 17:24:46 UTC

svn commit: r496748 - /incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java

Author: schor
Date: Tue Jan 16 08:24:45 2007
New Revision: 496748

URL: http://svn.apache.org/viewvc?view=rev&rev=496748
Log:
UIMA-85 http://issues.apache.org/jira/browse/UIMA-85
Make the trigger for open-in-new-window include mouse button 1
(the only button on a Mac) + the "CNTRL" key, which is the
convention for right clicking usually.

Also - fix the size of the add... and remove buttons on a Mac

Modified:
    incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java

Modified: incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java?view=diff&rev=496748&r1=496747&r2=496748
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/AggregateSection.java Tue Jan 16 08:24:45 2007
@@ -113,7 +113,14 @@
     newTableColumn(filesTable, 50, SWT.LEFT, "Delegate");
     newTableColumn(filesTable, 75, SWT.LEFT, "Key Name");
 
-    Composite bottomButtonContainer = newButtonContainer(tableContainer, HORIZONTAL_BUTTONS, 150);
+    // This little code fragment is an attempt to get the right sizing for the buttons
+    // Was wrong on Mac platforms
+    //   Word below is the longer of the two words in the button container
+    Button tempForSize = toolkit.createButton(tableContainer, "Remove", SWT.PUSH);
+    Point p = tempForSize.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+    tempForSize.dispose();
+    
+    Composite bottomButtonContainer = newButtonContainer(tableContainer, HORIZONTAL_BUTTONS, 3* p.x);
 
     addButton = newPushButton(bottomButtonContainer, S_ADD,
             "Click here to add a locally defined AE or CAS Consumer delegate", ENABLED);
@@ -227,11 +234,14 @@
         boolean bEnableButtons = (filesTable.getSelectionCount() > 0);
         removeButton.setEnabled(bEnableButtons);
         addToFlowButton.setEnabled(bEnableButtons);
-      } else if (event.type == SWT.MouseDown && event.button == 3) {
+      } else if (event.type == SWT.MouseDown && 
+                  (event.button == 3  || 
+                          // this is for Macintosh - they just have one button
+                   (event.button == 1 && (0 != (event.stateMask & SWT.CTRL))))) {
         handleTableContextMenuRequest(event);
       } else if (event.type == SWT.MouseHover && !bDisableToolTipHelp) {
         handleTableHoverHelp(event);
-      }
+      } 
       // Don't need this. Next mouse hover kills tool tip anyway
       // else if (event.type == SWT.MouseMove) {
       // filesTable.setToolTipText("");