~ubuntu-branches/ubuntu/wily/proguard/wily

« back to all changes in this revision

Viewing changes to src/proguard/gui/FilterDialog.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2014-04-10 13:58:11 UTC
  • mfrom: (1.2.5)
  • Revision ID: package-import@ubuntu.com-20140410135811-ddwzt2avu94rnolt
Tags: 4.11-1
* Team upload.
* New upstream release
* Removed the non-free documentation from the package (Closes: #719706)
* Removed the pre-built jars from the upstream tarball
* debian/control:
  - The package is now co-maintained with the Java Team
  - Standards-Version updated to 3.9.5 (no changes)
  - Added the Vcs-* fields
  - Added the Homepage field
* Switch to debhelper level 9
* Use XZ compression for the upstream tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3
3
 *             of Java bytecode.
4
4
 *
5
 
 * Copyright (c) 2002-2012 Eric Lafortune (eric@graphics.cornell.edu)
 
5
 * Copyright (c) 2002-2013 Eric Lafortune (eric@graphics.cornell.edu)
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify it
8
8
 * under the terms of the GNU General Public License as published by the Free
47
47
    public static final int APPROVE_OPTION = 0;
48
48
 
49
49
    private static final String DEFAULT_FILTER     = "**";
 
50
    private static final String DEFAULT_APK_FILTER = "**.apk";
50
51
    private static final String DEFAULT_JAR_FILTER = "**.jar";
 
52
    private static final String DEFAULT_AAR_FILTER = "**.aar";
51
53
    private static final String DEFAULT_WAR_FILTER = "**.war";
52
54
    private static final String DEFAULT_EAR_FILTER = "**.ear";
53
55
    private static final String DEFAULT_ZIP_FILTER = "**.zip";
54
56
 
55
57
 
56
58
    private final JTextField filterTextField    = new JTextField(40);
 
59
    private final JTextField apkFilterTextField = new JTextField(40);
57
60
    private final JTextField jarFilterTextField = new JTextField(40);
 
61
    private final JTextField aarFilterTextField = new JTextField(40);
58
62
    private final JTextField warFilterTextField = new JTextField(40);
59
63
    private final JTextField earFilterTextField = new JTextField(40);
60
64
    private final JTextField zipFilterTextField = new JTextField(40);
61
 
    private int        returnValue;
 
65
 
 
66
    private int returnValue;
62
67
 
63
68
 
64
69
    public FilterDialog(JFrame owner,
120
125
 
121
126
        // Create the filter labels.
122
127
        JLabel filterLabel    = new JLabel(msg("nameFilter"));
 
128
        JLabel apkFilterLabel = new JLabel(msg("apkNameFilter"));
123
129
        JLabel jarFilterLabel = new JLabel(msg("jarNameFilter"));
 
130
        JLabel aarFilterLabel = new JLabel(msg("aarNameFilter"));
124
131
        JLabel warFilterLabel = new JLabel(msg("warNameFilter"));
125
132
        JLabel earFilterLabel = new JLabel(msg("earNameFilter"));
126
133
        JLabel zipFilterLabel = new JLabel(msg("zipNameFilter"));
135
142
        filterPanel.add(tip(filterLabel,        "nameFilterTip"),     labelConstraints);
136
143
        filterPanel.add(tip(filterTextField,    "fileNameFilterTip"), textFieldConstraints);
137
144
 
 
145
        filterPanel.add(tip(apkFilterLabel,     "apkNameFilterTip"),  labelConstraints);
 
146
        filterPanel.add(tip(apkFilterTextField, "fileNameFilterTip"), textFieldConstraints);
 
147
 
138
148
        filterPanel.add(tip(jarFilterLabel,     "jarNameFilterTip"),  labelConstraints);
139
149
        filterPanel.add(tip(jarFilterTextField, "fileNameFilterTip"), textFieldConstraints);
140
150
 
 
151
        filterPanel.add(tip(aarFilterLabel,     "aarNameFilterTip"),  labelConstraints);
 
152
        filterPanel.add(tip(aarFilterTextField, "fileNameFilterTip"), textFieldConstraints);
 
153
 
141
154
        filterPanel.add(tip(warFilterLabel,     "warNameFilterTip"),  labelConstraints);
142
155
        filterPanel.add(tip(warFilterTextField, "fileNameFilterTip"), textFieldConstraints);
143
156
 
198
211
 
199
212
 
200
213
    /**
 
214
     * Sets the apk filter to be represented in this dialog.
 
215
     */
 
216
    public void setApkFilter(List filter)
 
217
    {
 
218
        apkFilterTextField.setText(filter != null ? ListUtil.commaSeparatedString(filter, true) : DEFAULT_APK_FILTER);
 
219
    }
 
220
 
 
221
 
 
222
    /**
 
223
     * Returns the apk filter currently represented in this dialog.
 
224
     */
 
225
    public List getApkFilter()
 
226
    {
 
227
        String filter = apkFilterTextField.getText();
 
228
 
 
229
        return filter.equals(DEFAULT_APK_FILTER) ? null : ListUtil.commaSeparatedList(filter);
 
230
    }
 
231
 
 
232
 
 
233
    /**
201
234
     * Sets the jar filter to be represented in this dialog.
202
235
     */
203
236
    public void setJarFilter(List filter)
218
251
 
219
252
 
220
253
    /**
 
254
     * Sets the aar filter to be represented in this dialog.
 
255
     */
 
256
    public void setAarFilter(List filter)
 
257
    {
 
258
        aarFilterTextField.setText(filter != null ? ListUtil.commaSeparatedString(filter, true) : DEFAULT_AAR_FILTER);
 
259
    }
 
260
 
 
261
 
 
262
    /**
 
263
     * Returns the aar filter currently represented in this dialog.
 
264
     */
 
265
    public List getAarFilter()
 
266
    {
 
267
        String filter = aarFilterTextField.getText();
 
268
 
 
269
        return filter.equals(DEFAULT_AAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
 
270
    }
 
271
 
 
272
 
 
273
    /**
221
274
     * Sets the war filter to be represented in this dialog.
222
275
     */
223
276
    public void setWarFilter(List filter)