You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/02/10 19:10:19 UTC

[GitHub] [netbeans] KacerCZ commented on a change in pull request #2755: [NETBEANS-5350] Improved Fix Uses dialog

KacerCZ commented on a change in pull request #2755:
URL: https://github.com/apache/netbeans/pull/2755#discussion_r574001791



##########
File path: php/php.editor/src/org/netbeans/modules/php/editor/actions/FixDuplicateImportStmts.java
##########
@@ -147,6 +153,58 @@ private static String getBundleString(String s) {
         return NbBundle.getMessage(FixDuplicateImportStmts.class, s);
     }
 
+    @NbBundle.Messages({
+        "ChangeNothingButton=Change Nothing",
+        "RestoreDefaultsButton=Restore Defaults"
+    })
+    private void initButtons(ImportData importData) {
+        int numberOfItems = importData.getItems().size();
+        defaultVariants = new ItemVariant[numberOfItems];
+        dontUseVariants = new ItemVariant[numberOfItems];
+        for (int i = 0; i < numberOfItems; i++) {
+            DataItem dataItem = importData.getItems().get(i);
+            defaultVariants[i] = dataItem.getDefaultVariant();
+            dontUseVariants[i] = dataItem.getDefaultVariant();
+            for (ItemVariant variant : dataItem.getVariants()) {
+                if (!variant.canBeUsed()) {
+                    dontUseVariants[i] = variant;
+                }
+            }
+        }
+
+        JPanel buttonsPanel = new JPanel(new BorderLayout(5, 3));
+        bottomPanel.add(buttonsPanel, BorderLayout.LINE_END);

Review comment:
       I used same way as "Remove unused uses" is added to `bottomPanel`.
   I don't know why it was not created in designer.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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