Skip to content

Commit 0b00d4b

Browse files
committed
Add copyright information and java documentation comments
1 parent 9cf0aa2 commit 0b00d4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+829
-140
lines changed

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/ExportAction.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions;
29

310
import com.intellij.openapi.actionSystem.AnAction;
@@ -12,11 +19,14 @@
1219

1320
/**
1421
* Action to export updated configuration file.
15-
*
16-
* @author Oshando Johnson
1722
*/
1823

1924
public class ExportAction extends AnAction {
25+
26+
/**
27+
* Obtains list of methods and creates new JSON file in the location specified by the user.
28+
* @param anActionEvent source event
29+
*/
2030
@Override
2131
public void actionPerformed(AnActionEvent anActionEvent) {
2232

@@ -49,6 +59,10 @@ public void actionPerformed(AnActionEvent anActionEvent) {
4959
}
5060
}
5161

62+
/**
63+
* Controls whether the action is enabled or disabled
64+
* @param event source event
65+
*/
5266
@Override
5367
public void update(AnActionEvent event) {
5468

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/HelpAction.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
package de.fraunhofer.iem.swan.assist.actions;
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
27

8+
package de.fraunhofer.iem.swan.assist.actions;
39

410
import com.intellij.notification.Notification;
511
import com.intellij.notification.NotificationType;
@@ -18,13 +24,14 @@
1824
import java.util.ResourceBundle;
1925

2026
/**
21-
* Action to open help page or resources.
22-
*
23-
* @author Oshando Johnson
27+
* Action to open help page and/or plugin resources.
2428
*/
25-
2629
public class HelpAction extends AnAction {
2730

31+
/**
32+
* Opens help page in user's default browser
33+
* @param e source event
34+
*/
2835
@Override
2936
public void actionPerformed(AnActionEvent e) {
3037

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/ImportAction.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions;
29

310
import com.intellij.openapi.actionSystem.AnAction;
@@ -14,13 +21,13 @@
1421

1522
/**
1623
* Action to import configuration file.
17-
*
18-
* @author Oshando Johnson
1924
*/
20-
21-
2225
public class ImportAction extends AnAction {
2326

27+
/**
28+
* Allows user to select configuration file that is then loaded.
29+
* @param e source event
30+
*/
2431
@Override
2532
public void actionPerformed(AnActionEvent e) {
2633

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/LaunchSwanAction.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions;
29

310
import com.intellij.openapi.actionSystem.AnAction;
@@ -23,14 +30,14 @@
2330
import java.util.Properties;
2431

2532
/**
26-
* Action to start load dialog for configuring SWAN before running.
27-
*
28-
* @author Oshando Johnson
33+
* Action opens dialog for user to set parameters for running SWAN. After which thread is created to run SWAN.
2934
*/
30-
31-
3235
public class LaunchSwanAction extends AnAction {
3336

37+
/**
38+
* Obtains application parameters from user, exports updated JSON file and starts thread to run SWAN.
39+
* @param anActionEvent source event
40+
*/
3441
@Override
3542
public void actionPerformed(AnActionEvent anActionEvent) {
3643

@@ -93,6 +100,10 @@ public void actionPerformed(AnActionEvent anActionEvent) {
93100
}
94101
}
95102

103+
/**
104+
* Controls whether the action is enabled or disabled
105+
* @param event source event
106+
*/
96107
@Override
97108
public void update(AnActionEvent event) {
98109

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/SuggestAction.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions;
29

310
import com.intellij.openapi.actionSystem.AnAction;
@@ -14,9 +21,13 @@
1421
*/
1522
public class SuggestAction extends AnAction {
1623

24+
/**
25+
* Obtains suggested methods from SWAN and loads them in a dialog for user classification.
26+
* @param e source event
27+
*/
1728
@Override
1829
public void actionPerformed(AnActionEvent e) {
19-
// TODO: insert action logic here
30+
// TODO: implement logic to obtain methods from SWAN
2031

2132
HashMap<String,MethodWrapper> suggestedMethods = new HashMap<>();
2233

@@ -33,6 +44,10 @@ public void actionPerformed(AnActionEvent e) {
3344
dialog.show();
3445
}
3546

47+
/**
48+
* Controls whether the action is enabled or disabled
49+
* @param event source event
50+
*/
3651
@Override
3752
public void update(AnActionEvent event) {
3853

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/SwanProcessBuilder.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions;
29

310
import com.intellij.openapi.project.Project;
@@ -12,26 +19,28 @@
1219
import java.util.HashMap;
1320
import java.util.ResourceBundle;
1421

15-
1622
/**
17-
* Creates process to run SWAN.
18-
*
19-
* @author Oshando Johnson
23+
* Creates process to run SWAN on a separate thread.
2024
*/
21-
22-
23-
//Executes SWAN with updated configuration file on a separate thread.
2425
public class SwanProcessBuilder extends Thread {
2526

2627
private static HashMap<String, String> parameters;
2728
private Project project;
2829

30+
/**
31+
* Initializes builder.
32+
* @param project Project on which the plugin is being used with
33+
* @param param Parameters that will be used as program arguments
34+
*/
2935
SwanProcessBuilder(Project project, HashMap<String, String> param) {
3036

3137
this.project = project;
3238
parameters = param;
3339
}
3440

41+
/**
42+
* Sets up process to run the application and also send notification to subscribers when finished.
43+
*/
3544
public void run() {
3645
super.run();
3746

@@ -88,6 +97,11 @@ public void run() {
8897
publisher.launchSwan(results);
8998
}
9099

100+
/**
101+
* Get the timestamp in a specified format.
102+
* @param dateFormat Date format that should be used.
103+
* @return Formatted date
104+
*/
91105
private String getCurrentTimestamp(String dateFormat) {
92106

93107
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/filter/CategoryActionGroup.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions.filter;
29

310
import com.intellij.openapi.actionSystem.ActionGroup;
@@ -14,20 +21,32 @@
1421
import java.util.ArrayList;
1522

1623
/**
17-
* Groups actions that process categories.
18-
*
19-
* @author Oshando Johnson
24+
* Manages group of categories that is used for filtering.
2025
*/
21-
2226
public class CategoryActionGroup extends ActionGroup {
2327

28+
/**
29+
* Creates new category action group.
30+
*/
2431
public CategoryActionGroup() {
2532
}
2633

34+
/**
35+
* Creates new category action group.
36+
*
37+
* @param name the name of the category
38+
* @param popup whether or not the group is a popup menu
39+
*/
2740
public CategoryActionGroup(String name, boolean popup) {
2841
super(name, popup);
2942
}
3043

44+
/**
45+
* Obtains all supported types and CWEs and builds filter groups.
46+
*
47+
* @param anActionEvent event that triggered the action
48+
* @return An array of categories that should be added to the menu.
49+
*/
3150
@NotNull
3251
@Override
3352
public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/filter/FilterAction.java

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions.filter;
29

310

@@ -12,25 +19,34 @@
1219
import javafx.util.Pair;
1320

1421
/**
15-
* Action to filter list of methods.
16-
*
17-
* @author Oshando Johnson
22+
* Plugin action to filter method list.
1823
*/
1924

2025
public class FilterAction extends AnAction {
2126

2227
private Pair<String, String> filterPair;
2328

29+
/**
30+
* Initializes action.
31+
*/
2432
public FilterAction() {
2533

2634
}
2735

36+
/**
37+
* Initializes action using the key-value pair.
38+
* @param filter name and type of the filter
39+
*/
2840
public FilterAction(Pair<String, String> filter) {
2941
super(filter.getValue());
3042

3143
filterPair = filter;
3244
}
3345

46+
/**
47+
* Listener for filter actions.
48+
* @param e source event
49+
*/
3450
@Override
3551
public void actionPerformed(AnActionEvent e) {
3652

@@ -41,7 +57,10 @@ public void actionPerformed(AnActionEvent e) {
4157
filterNotifier.updateFilter(filterPair);
4258
}
4359

44-
60+
/**
61+
* Controls whether the action is enabled or disabled
62+
* @param event source event
63+
*/
4564
@Override
4665
public void update(AnActionEvent event) {
4766

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/filter/FilterActionGroup.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2018 Fraunhofer IEM, Paderborn, Germany.
3+
*
4+
* Contributors:
5+
* Oshando Johnson (oshando.johnson@iem.fraunhofer.de ) - initial implementation
6+
******************************************************************************/
7+
18
package de.fraunhofer.iem.swan.assist.actions.filter;
29

310
import com.intellij.openapi.actionSystem.ActionGroup;
@@ -17,6 +24,11 @@
1724

1825
public class FilterActionGroup extends ActionGroup {
1926

27+
/**
28+
* Creates list of filters.
29+
* @param anActionEvent source event
30+
* @return An array of filters that can be applied to the list
31+
*/
2032
@NotNull
2133
@Override
2234
public AnAction[] getChildren(@Nullable AnActionEvent anActionEvent) {
@@ -38,6 +50,10 @@ public boolean isPopup() {
3850
return true;
3951
}
4052

53+
/**
54+
* Controls whether the action is enabled or disabled
55+
* @param event source event
56+
*/
4157
@Override
4258
public void update(AnActionEvent event) {
4359

0 commit comments

Comments
 (0)