Skip to content

Commit 896d0ff

Browse files
console/plugins/planning/PlanEditor: Option to hide plan templates use.
1 parent 08d39c1 commit 896d0ff

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/java/pt/lsts/neptus/console/plugins/planning/PlanEditor.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
public class PlanEditor extends InteractionAdapter implements Renderer2DPainter,
183183
MissionChangeListener, ConfigurationListener {
184184

185+
public static boolean exposePlanTemplatesA = true;
186+
185187
private static final long serialVersionUID = 1L;
186188
private final String defaultCondition = "ManeuverIsDone";
187189
private MissionType mission = null;
@@ -2515,13 +2517,20 @@ public void missionUpdated(MissionType mission) {
25152517
public void initSubPanel() {
25162518
this.mission = getConsole().getMission();
25172519

2518-
addMenuItem(I18n.text("Tools") + ">" + I18n.text("Generate plan..."), ImageUtils.getIcon("images/planning/template.png"), new ActionListener() {
2520+
if (exposePlanTemplatesA) {
2521+
addMenuItem(I18n.text("Tools") + ">" + I18n.text("Generate plan..."), ImageUtils.getIcon("images/planning/template.png"), new ActionListener() {
2522+
@Override
2523+
public void actionPerformed(ActionEvent e) {
2524+
new PlanTemplatesDialog(getConsole()).showDialog();
2525+
}
2526+
});
2527+
}
2528+
}
25192529

2520-
@Override
2521-
public void actionPerformed(ActionEvent e) {
2522-
new PlanTemplatesDialog(getConsole()).showDialog();
2523-
}
2524-
});
2530+
@Override
2531+
public void cleanSubPanel() {
2532+
super.cleanSubPanel();
2533+
removeMenuItem(I18n.text("Tools") + ">" + I18n.text("Generate plan..."));
25252534
}
25262535

25272536
public void updateSelected(Maneuver m) {

0 commit comments

Comments
 (0)