diff options
author | Brian Carlstrom <bdc@google.com> | 2015-01-08 08:24:06 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2015-01-08 09:27:15 -0800 |
commit | 2270795fbe0b277bfd49f40950ecaa78583175cc (patch) | |
tree | 9ac962825d41c4fb8ad1ec0fc2e8b441b42d3869 /src/proguard/gui/FilterDialog.java | |
parent | 9961286c06c25cd03464d3e2b00bd9b9dedf96ba (diff) | |
download | proguard-2270795fbe0b277bfd49f40950ecaa78583175cc.tar.gz |
Upgrade Proguard to 5.1.
Downloaded from:
http://sourceforge.net/projects/proguard/files/proguard/5.1/
Bug: 17550647
Change-Id: I2b4eab16eb7821fc232b294ab7f433aae08f71e1
Diffstat (limited to 'src/proguard/gui/FilterDialog.java')
-rw-r--r-- | src/proguard/gui/FilterDialog.java | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/src/proguard/gui/FilterDialog.java b/src/proguard/gui/FilterDialog.java index 88dbd8b..d96684e 100644 --- a/src/proguard/gui/FilterDialog.java +++ b/src/proguard/gui/FilterDialog.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -47,18 +47,23 @@ public class FilterDialog extends JDialog public static final int APPROVE_OPTION = 0; private static final String DEFAULT_FILTER = "**"; + private static final String DEFAULT_APK_FILTER = "**.apk"; private static final String DEFAULT_JAR_FILTER = "**.jar"; + private static final String DEFAULT_AAR_FILTER = "**.aar"; private static final String DEFAULT_WAR_FILTER = "**.war"; private static final String DEFAULT_EAR_FILTER = "**.ear"; private static final String DEFAULT_ZIP_FILTER = "**.zip"; private final JTextField filterTextField = new JTextField(40); + private final JTextField apkFilterTextField = new JTextField(40); private final JTextField jarFilterTextField = new JTextField(40); + private final JTextField aarFilterTextField = new JTextField(40); private final JTextField warFilterTextField = new JTextField(40); private final JTextField earFilterTextField = new JTextField(40); private final JTextField zipFilterTextField = new JTextField(40); - private int returnValue; + + private int returnValue; public FilterDialog(JFrame owner, @@ -120,7 +125,9 @@ public class FilterDialog extends JDialog // Create the filter labels. JLabel filterLabel = new JLabel(msg("nameFilter")); + JLabel apkFilterLabel = new JLabel(msg("apkNameFilter")); JLabel jarFilterLabel = new JLabel(msg("jarNameFilter")); + JLabel aarFilterLabel = new JLabel(msg("aarNameFilter")); JLabel warFilterLabel = new JLabel(msg("warNameFilter")); JLabel earFilterLabel = new JLabel(msg("earNameFilter")); JLabel zipFilterLabel = new JLabel(msg("zipNameFilter")); @@ -135,9 +142,15 @@ public class FilterDialog extends JDialog filterPanel.add(tip(filterLabel, "nameFilterTip"), labelConstraints); filterPanel.add(tip(filterTextField, "fileNameFilterTip"), textFieldConstraints); + filterPanel.add(tip(apkFilterLabel, "apkNameFilterTip"), labelConstraints); + filterPanel.add(tip(apkFilterTextField, "fileNameFilterTip"), textFieldConstraints); + filterPanel.add(tip(jarFilterLabel, "jarNameFilterTip"), labelConstraints); filterPanel.add(tip(jarFilterTextField, "fileNameFilterTip"), textFieldConstraints); + filterPanel.add(tip(aarFilterLabel, "aarNameFilterTip"), labelConstraints); + filterPanel.add(tip(aarFilterTextField, "fileNameFilterTip"), textFieldConstraints); + filterPanel.add(tip(warFilterLabel, "warNameFilterTip"), labelConstraints); filterPanel.add(tip(warFilterTextField, "fileNameFilterTip"), textFieldConstraints); @@ -198,6 +211,26 @@ public class FilterDialog extends JDialog /** + * Sets the apk filter to be represented in this dialog. + */ + public void setApkFilter(List filter) + { + apkFilterTextField.setText(filter != null ? ListUtil.commaSeparatedString(filter, true) : DEFAULT_APK_FILTER); + } + + + /** + * Returns the apk filter currently represented in this dialog. + */ + public List getApkFilter() + { + String filter = apkFilterTextField.getText(); + + return filter.equals(DEFAULT_APK_FILTER) ? null : ListUtil.commaSeparatedList(filter); + } + + + /** * Sets the jar filter to be represented in this dialog. */ public void setJarFilter(List filter) @@ -218,6 +251,26 @@ public class FilterDialog extends JDialog /** + * Sets the aar filter to be represented in this dialog. + */ + public void setAarFilter(List filter) + { + aarFilterTextField.setText(filter != null ? ListUtil.commaSeparatedString(filter, true) : DEFAULT_AAR_FILTER); + } + + + /** + * Returns the aar filter currently represented in this dialog. + */ + public List getAarFilter() + { + String filter = aarFilterTextField.getText(); + + return filter.equals(DEFAULT_AAR_FILTER) ? null : ListUtil.commaSeparatedList(filter); + } + + + /** * Sets the war filter to be represented in this dialog. */ public void setWarFilter(List filter) |