Fix #680.
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / view / bookmark / BookmarkView.java
index e266cb4..c4e2e13 100644 (file)
@@ -13,6 +13,7 @@ import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.action.Separator;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.OpenEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
@@ -183,21 +184,21 @@ public class BookmarkView extends ViewPart implements PropertyChangeListener {
                IPreferenceStore store = QuantumPlugin.getDefault().getPreferenceStore();
         String text1 = store.getString("customCopyName1");
         if (text1 != null && text1.trim().length() > 0) {
-                       this.customCopyAction1 = new CustomCopyAction(this,1); // 1 is unused, just in case more custom copies are defined        
+                       this.customCopyAction1 = new CustomCopyAction(1); // 1 is unused, just in case more custom copies are defined        
                        this.customCopyAction1.setText(text1); //$NON-NLS-1$
                        this.customCopyAction1.setImageDescriptor(
                                        ImageStore.getImageDescriptor(ImageStore.COPY)); //$NON-NLS-1$
         }
         String text2 = store.getString("customCopyName2");
         if (text2 != null && text1.trim().length() > 0) {
-                       this.customCopyAction2 = new CustomCopyAction(this,2); // 1 is unused, just in case more custom copies are defined        
+                       this.customCopyAction2 = new CustomCopyAction(2); // 1 is unused, just in case more custom copies are defined        
                        this.customCopyAction2.setText(text2); //$NON-NLS-1$
                        this.customCopyAction2.setImageDescriptor(
                                        ImageStore.getImageDescriptor(ImageStore.COPY)); //$NON-NLS-1$
         }
         String text3 = store.getString("customCopyName3");
         if (text3 != null && text1.trim().length() > 0) {
-                       this.customCopyAction3 = new CustomCopyAction(this,3); // 1 is unused, just in case more custom copies are defined        
+                       this.customCopyAction3 = new CustomCopyAction(3); // 1 is unused, just in case more custom copies are defined        
                        this.customCopyAction3.setText(text3); //$NON-NLS-1$
                        this.customCopyAction3.setImageDescriptor(
                                        ImageStore.getImageDescriptor(ImageStore.COPY)); //$NON-NLS-1$
@@ -251,12 +252,15 @@ public class BookmarkView extends ViewPart implements PropertyChangeListener {
                        mgr.add(new Separator());
                        MenuManager subMenu = new MenuManager(Messages.getString("bookmarkview.customCopyAction")); 
                        if (this.customCopyAction1 != null) {
+                           customCopyAction1.selectionChanged(selection);
                                subMenu.add(customCopyAction1);
                        }
                        if (this.customCopyAction2 != null) {
+                               customCopyAction2.selectionChanged(selection);
                                subMenu.add(customCopyAction2);
                        }
                        if (this.customCopyAction3 != null) {
+                               customCopyAction3.selectionChanged(selection);
                                subMenu.add(customCopyAction3);
                        }
                        mgr.add(subMenu);
@@ -274,12 +278,15 @@ public class BookmarkView extends ViewPart implements PropertyChangeListener {
                                        || this.customCopyAction3 != null)) {
             MenuManager subMenu = new MenuManager(Messages.getString("bookmarkview.customCopyAction")); 
             if (this.customCopyAction1 != null) {
-            subMenu.add(customCopyAction1);
+               customCopyAction1.selectionChanged(selection);
+               subMenu.add(customCopyAction1);
             }
             if (this.customCopyAction2 != null) {
+               customCopyAction2.selectionChanged(selection);
                subMenu.add(customCopyAction2);
             }
             if (this.customCopyAction3 != null) {
+               customCopyAction3.selectionChanged(selection);
                subMenu.add(customCopyAction3);
             }
             mgr.add(subMenu);