@@ -68,11 +68,14 @@ public class GithubIssueGUI extends JFrame implements WindowListener, ActionList
68
68
private JTextField inputXlsPath ;
69
69
private JTextField inputLocale ;
70
70
71
- private JComboBox <String > inputStateCombo ;
71
+ private JComboBox <String > inputStateCombo , inputAssignDateCombo ;
72
72
73
73
private String labelStateOpen ;
74
74
private String labelStateClosed ;
75
75
private String labelStateAll ;
76
+
77
+ private String labelAssignDateDefault ;
78
+ private String labelAssignDateSkip ;
76
79
77
80
private transient ResourceBundle lagelBundle ;
78
81
@@ -182,6 +185,7 @@ private void initConf() {
182
185
this .inputRepoPass = new JPasswordField ( savedPass );
183
186
this .inputXlsPath = newJTextField ( this .config .getProperty ( GithubIssueExport .ARG_XLSFILE , defaultInputText ) );
184
187
this .inputLocale = newJTextField ( defaultLocale );
188
+ // input state combo
185
189
this .inputStateCombo = new JComboBox <>();
186
190
this .labelStateOpen = this .lagelBundle .getString ( "label.input.state.open" );
187
191
this .labelStateClosed = this .lagelBundle .getString ( "label.input.state.closed" );
@@ -199,7 +203,18 @@ private void initConf() {
199
203
this .inputStateCombo .setSelectedItem ( this .labelStateAll );
200
204
}
201
205
}
202
-
206
+ // input assign date handling combo
207
+ this .inputAssignDateCombo = new JComboBox <>();
208
+ this .labelAssignDateDefault = this .lagelBundle .getString ( "label.input.assignDate.default" );
209
+ this .labelAssignDateSkip = this .lagelBundle .getString ( "label.input.assignDate.skip" );
210
+ this .inputAssignDateCombo .addItem ( this .labelAssignDateDefault );
211
+ this .inputAssignDateCombo .addItem ( this .labelAssignDateSkip );
212
+ String selectedStateAssignDate = this .config .getProperty ( GithubIssueExport .ARG_ASSIGNEE_DATE_MODE );
213
+ if ( GithubIssueExport .ARG_ASSIGNEE_DATE_MODE_SKIP .equalsIgnoreCase ( selectedStateAssignDate ) ) {
214
+ this .inputAssignDateCombo .setSelectedItem ( this .labelAssignDateSkip );
215
+ } else {
216
+ this .inputAssignDateCombo .setSelectedItem ( this .labelAssignDateDefault );
217
+ }
203
218
// buttons
204
219
this .buttonSaveConfiguration = new JButton ( this .lagelBundle .getString ( "button.input.configuration.save" ) );
205
220
this .buttonSaveConfiguration .addActionListener ( this );
@@ -246,7 +261,7 @@ private void initLayout() {
246
261
// add row
247
262
JPanel reportPanel2 = new JPanel ( new GridLayout ( 1 , 2 ) );
248
263
newRowPanel ( newJLabel ( this .lagelBundle .getString ( "label.input.output.xls" ) ), this .inputXlsPath , reportPanel2 );
249
- reportPanel2 . add ( new JLabel ( "" ) );
264
+ newRowPanel ( newJLabel ( this . lagelBundle . getString ( "label.input.assignDate.label " ) ), this . inputAssignDateCombo , reportPanel2 );
250
265
addRow ( reportPanel2 , mainPanel );
251
266
// add row
252
267
addRow ( new JLabel ( "" ), mainPanel );
@@ -357,6 +372,9 @@ private void performMainAction( Object source ) {
357
372
this .config .setProperty ( GithubIssueExport .ARG_PROXY_PASS , new String ( this .inputProxyPass .getPassword () ) );
358
373
this .config .setProperty ( GithubIssueExport .ARG_GITHUB_USER , this .inputRepoUser .getText () );
359
374
this .config .setProperty ( GithubIssueExport .ARG_GITHUB_PASS , new String ( this .inputRepoPass .getPassword () ) );
375
+ if ( this .inputAssignDateCombo .getSelectedItem () == this .labelAssignDateSkip ) {
376
+ this .config .setProperty ( GithubIssueExport .ARG_ASSIGNEE_DATE_MODE , GithubIssueExport .ARG_ASSIGNEE_DATE_MODE_SKIP );
377
+ }
360
378
String selectedState = this .inputStateCombo .getSelectedItem ().toString ();
361
379
if ( selectedState .equalsIgnoreCase ( this .labelStateOpen ) ) {
362
380
this .config .setProperty ( GithubIssueExport .ARG_STATE , GithubIssueExport .ARG_STATE_OPEN );
@@ -365,6 +383,13 @@ private void performMainAction( Object source ) {
365
383
} else if ( selectedState .equalsIgnoreCase ( this .labelStateAll ) ) {
366
384
this .config .setProperty ( GithubIssueExport .ARG_STATE , GithubIssueExport .ARG_STATE_ALL );
367
385
}
386
+ // skip assign date
387
+ String selectedStateAssignDateMode = this .inputAssignDateCombo .getSelectedItem ().toString ();
388
+ if ( selectedStateAssignDateMode .equalsIgnoreCase ( this .labelAssignDateSkip ) ) {
389
+ this .config .setProperty ( GithubIssueExport .ARG_ASSIGNEE_DATE_MODE , GithubIssueExport .ARG_ASSIGNEE_DATE_MODE_SKIP );
390
+ } else {
391
+ this .config .remove ( GithubIssueExport .ARG_ASSIGNEE_DATE_MODE );
392
+ }
368
393
if ( source == this .buttonGenerateReport ) {
369
394
if ( StringUtils .isEmpty ( this .inputXlsPath .getText () ) ) {
370
395
this .outputArea .setText ( this .lagelBundle .getString ( "label.output.area.generate.validate.noOutputFile" ) );
@@ -390,7 +415,7 @@ private void performMainAction( Object source ) {
390
415
String baseText = this .lagelBundle .getString ( "label.output.area.configuration.saved" );
391
416
this .outputArea .setText ( baseText +" " +this .configSavePath .getAbsolutePath () );
392
417
} catch (Exception ex ) {
393
- logger .warn ( "Failed to save configuration " + this .configSavePath , ex );
418
+ logger .warn ( String . format ( "Failed to save configuration %s" , this .configSavePath ) , ex );
394
419
}
395
420
this .config .setProperty ( GithubIssueExport .ARG_GITHUB_PASS , tempPass1 );
396
421
this .config .setProperty ( GithubIssueExport .ARG_PROXY_PASS , tempPass2 );
0 commit comments