public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-util/netbeans/files/6.7: autoupdate.ui.fix.patch
@ 2009-06-09 10:36 Miroslav Sulc (fordfrog)
  0 siblings, 0 replies; 2+ messages in thread
From: Miroslav Sulc (fordfrog) @ 2009-06-09 10:36 UTC (permalink / raw
  To: gentoo-commits

fordfrog    09/06/09 10:36:03

  Added:                autoupdate.ui.fix.patch
  Log:
  netbeans-6.7_rc2_p1: added patch that fixes problem with plugins activation/deactivation
  (Portage version: 2.1.6.13/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-util/netbeans/files/6.7/autoupdate.ui.fix.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/netbeans/files/6.7/autoupdate.ui.fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/netbeans/files/6.7/autoupdate.ui.fix.patch?rev=1.1&content-type=text/plain

Index: autoupdate.ui.fix.patch
===================================================================
diff -r 5fb0d903fe36 autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Unit.java
--- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Unit.java	Mon Jun 08 19:00:44 2009 +0200
+++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/Unit.java	Tue Jun 09 10:43:27 2009 +0200
@@ -262,7 +262,7 @@
         
         private UpdateElement installEl = null;
         private UpdateElement backupEl = null;
-        private boolean isUninstallAllowed ;
+        private Boolean alternateMarked;
         
         public static boolean isOperationAllowed (UpdateUnit uUnit, UpdateElement element, OperationContainer<OperationSupport> container) {
             return container.canBeAdded (uUnit, element);
@@ -285,11 +285,23 @@
             } else {
                 container = Containers.forUninstall ();
             }
-            this.isUninstallAllowed = isOperationAllowed (this.updateUnit, installEl, container);
+            if (isOperationAllowed (this.updateUnit, installEl, container)) {
+                alternateMarked = null;
+            } else {
+                alternateMarked = false;
+            }
             initState();
+        }
+
+        public boolean isUninstallAllowed() {
+            return alternateMarked == null;
         }
         
         public boolean isMarked () {
+            if (alternateMarked != null) {
+                return alternateMarked;
+            }
+
             OperationContainer container = null;
             if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == updateUnit.getType ()) {
                 container = Containers.forCustomUninstall ();
@@ -301,16 +313,20 @@
         
         public void setMarked (boolean marked) {
             assert marked != isMarked ();
-            OperationContainer container = null;
-            if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == updateUnit.getType ()) {
-                container = Containers.forCustomUninstall ();
+            if (isUninstallAllowed()) {
+                OperationContainer container = null;
+                if (UpdateManager.TYPE.CUSTOM_HANDLED_COMPONENT == updateUnit.getType ()) {
+                    container = Containers.forCustomUninstall ();
+                } else {
+                    container = Containers.forUninstall ();
+                }
+                if (marked) {
+                    container.add (updateUnit, installEl);
+                } else {
+                    container.remove (installEl);
+                }
             } else {
-                container = Containers.forUninstall ();
-            }
-            if (marked) {
-                container.add (updateUnit, installEl);
-            } else {
-                container.remove (installEl);
+                alternateMarked = marked;
             }
         }
         
@@ -340,15 +356,6 @@
                 return new SpecificationVersion (unit1.getInstalledVersion ()).compareTo (new SpecificationVersion (unit2.getInstalledVersion ()));
             }
             return Unit.compareDisplayVersions (u1, u2);
-        }
-        
-        @Override
-        public boolean canBeMarked () {
-            if (super.canBeMarked ()) {
-                return isUninstallAllowed ;
-            } else {
-                return false;
-            }
         }
         
         public String getInstalledVersion () {
diff -r 5fb0d903fe36 autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java
--- a/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java	Mon Jun 08 19:00:44 2009 +0200
+++ b/autoupdate.ui/src/org/netbeans/modules/autoupdate/ui/UnitTab.java	Tue Jun 09 10:43:27 2009 +0200
@@ -1178,6 +1178,25 @@
                 focusTable ();
             }
         }
+
+        @Override
+        public void tableDataChanged (Collection<Unit> units) {
+            if (units.size() == 0) {
+                setEnabled(false);
+                return;
+            }
+            for (Unit u : units) {
+                if (u instanceof Unit.Installed) {
+                    Unit.Installed inst = (Unit.Installed)u;
+                    if (!inst.isUninstallAllowed()) {
+                        setEnabled(false);
+                        return;
+                    }
+                }
+            }
+            setEnabled (true);
+        }
+
     }
     
     private class UpdateAction extends TabAction {






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-util/netbeans/files/6.7: autoupdate.ui.fix.patch
@ 2009-06-19 19:33 Miroslav Sulc (fordfrog)
  0 siblings, 0 replies; 2+ messages in thread
From: Miroslav Sulc (fordfrog) @ 2009-06-19 19:33 UTC (permalink / raw
  To: gentoo-commits

fordfrog    09/06/19 19:33:22

  Removed:              autoupdate.ui.fix.patch
  Log:
  File removed but for some reason not committed as removed



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-06-19 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-09 10:36 [gentoo-commits] gentoo-x86 commit in dev-util/netbeans/files/6.7: autoupdate.ui.fix.patch Miroslav Sulc (fordfrog)
  -- strict thread matches above, loose matches on Subject: below --
2009-06-19 19:33 Miroslav Sulc (fordfrog)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox