peedeeboy opened a new pull request #1090: [Netbeans 1148] Fix for trying to 
add several jigsaw modules to modulepath at once will add one; the rest goes to 
classpath 
URL: https://github.com/apache/incubator-netbeans/pull/1090
 
 
   Amends two instances of PathsCustomizer class (one for Java SE Projects, on 
for Java SE Modular Projects):
   
   
\java\java.j2semodule\src\org\netbeans\modules\java\j2semodule\ui\customizer\PathsCustomizer.java
   
\java\java.j2seproject\src\org\netbeans\modules\java\j2seproject\ui\customizer\PathsCustomizer.java
   
   The original author had an inner class JoinModel, with two ListModels:
   
   mpModel to represent .jar files on the Modulepath
   cpModeul to represent .jar files on the Classpath
   
   both behind one ListModel interface.  When a user clicked on the 'Add 
JAR/Folder' context menu option in the Project Properties UI, the 'active' 
variable was set depending on if the add button for modulepath or classpath was 
the one selected.
   
   This worked great for one .jar at a time.  Problem was that when the add() 
method was called in a for() loop to add multiple .jar files, the 'active=0' 
line would reset the 'active' variable after that first iteration and 
subsequent .jar files would default to the classpath.
   
   This code adds a new variable previousActive, which is used to store the 
last state of active when the add() or addElement() methods are called multiple 
times in a row (e.g. from a loop).
   
   To prevent breaking other functionality (such as 'Move Up', 'Move Down'), we 
have to clear the 'previousActive' variable whenever other actions are 
performed (i.e. the same places the 'active' variable was already getting 
cleared).
   
   Hope this is helpful :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to