Merge branch 'on_demand_debugger' into fix_mac_os_save

This commit is contained in:
A Pottinger
2020-04-26 09:21:11 -07:00
18 changed files with 417 additions and 176 deletions

View File

@@ -11,7 +11,12 @@ org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false
org.eclipse.jdt.core.formatter.align_with_spaces=false
org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -20,24 +25,39 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=36
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0
org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_module_statements=16
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16
org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18
org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0
org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0
org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=1
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
@@ -46,6 +66,7 @@ org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
@@ -55,32 +76,38 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false
org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=true
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.indent_tag_description=false
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=1
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=1
org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=false
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -92,6 +119,7 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=2
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
@@ -101,6 +129,7 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
@@ -114,11 +143,15 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
@@ -145,9 +178,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declar
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -172,13 +210,20 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert
org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
@@ -222,9 +267,13 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_decla
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -261,9 +310,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -275,20 +327,59 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_decla
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false
org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never
org.eclipse.jdt.core.formatter.lineSplit=80
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=true
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines
org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=space
org.eclipse.jdt.core.formatter.tabulation.size=2
org.eclipse.jdt.core.formatter.text_block_indentation=0
org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true
org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true
org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true
org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true
org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true
org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true
org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

View File

@@ -1,4 +1,4 @@
eclipse.preferences.version=1
formatter_profile=_processing
formatter_settings_version=12
formatter_settings_version=18
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>

View File

@@ -1,4 +1,3 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
@@ -76,17 +75,17 @@ public class JavaEditor extends Editor {
protected LineHighlight currentLine; // where the debugger is suspended
protected final String breakpointMarkerComment = " //<>//";
protected JMenuItem inspectorItem;
JMenu modeMenu;
// protected JMenuItem inspectorItem;
static final int ERROR_TAB_INDEX = 0;
private boolean hasJavaTabs;
private boolean javaTabWarned;
// To ensure proper initalization, do not use these variables directly. Instead, call
// or override getPreprocessingService and getDebugger.
private PreprocService preprocService;
private Debugger debugger;
protected PreprocService preprocService;
protected Debugger debugger;
private InspectMode inspect;
private ShowUsage usage;
@@ -107,11 +106,13 @@ public class JavaEditor extends Editor {
jmode = (JavaMode) mode;
debugger = new Debugger(this);
debugger.populateMenu(modeMenu);
// set breakpoints from marker comments
Debugger targetDebugger = getDebugger();
for (LineID lineID : stripBreakpointComments()) {
//System.out.println("setting: " + lineID);
targetDebugger.setBreakpoint(lineID);
debugger.setBreakpoint(lineID);
}
// setting breakpoints will flag sketch as modified, so override this here
getSketch().setModified(false);
@@ -134,18 +135,19 @@ public class JavaEditor extends Editor {
box.add(textAndError);
*/
preprocService = new PreprocService(this);
pdexEnabled = !hasJavaTabs();
PreprocService targetPreprocService = getPreprocessingService();
usage = new ShowUsage(this, targetPreprocService);
inspect = new InspectMode(this, targetPreprocService, usage);
rename = new Rename(this, targetPreprocService, usage);
usage = new ShowUsage(this, preprocService);
inspect = new InspectMode(this, preprocService, usage);
rename = new Rename(this, preprocService, usage);
if (SHOW_AST_VIEWER) {
astViewer = new ASTViewer(this, targetPreprocService);
astViewer = new ASTViewer(this, preprocService);
}
errorChecker = new ErrorChecker(this, targetPreprocService);
errorChecker = new ErrorChecker(this, preprocService);
for (SketchCode code : getSketch().getCode()) {
Document document = code.getDocument();
@@ -197,7 +199,7 @@ public class JavaEditor extends Editor {
if (preprocService != null) {
if (hasJavaTabsChanged) {
getPreprocessingService().handleHasJavaTabsChange(hasJavaTabs);
preprocService.handleHasJavaTabsChange(hasJavaTabs);
pdexEnabled = !hasJavaTabs;
if (!pdexEnabled) {
usage.hide();
@@ -269,7 +271,7 @@ public class JavaEditor extends Editor {
public void actionPerformed(ActionEvent e) {
if (isDebuggerEnabled()) {
Messages.log("Invoked 'Stop' menu item");
getDebugger().stopDebug();
debugger.stopDebug();
} else {
handleStop();
}
@@ -1099,13 +1101,12 @@ public class JavaEditor extends Editor {
if (isDebuggerEnabled()) {
// Hitting Run while a sketch is running should restart the sketch
// https://github.com/processing/processing/issues/3623
Debugger targetDebugger = getDebugger();
if (targetDebugger.isStarted()) {
targetDebugger.stopDebug();
if (debugger.isStarted()) {
debugger.stopDebug();
}
// Don't start the sketch paused, continue until a breakpoint or error
// https://github.com/processing/processing/issues/3096
targetDebugger.continueDebug();
debugger.continueDebug();
} else {
handleLaunch(false, false);
@@ -1161,9 +1162,9 @@ public class JavaEditor extends Editor {
* session or performs standard stop action if not currently debugging.
*/
public void handleStop() {
Debugger targetDebugger = getDebugger();
if (targetDebugger.isStarted()) {
targetDebugger.stopDebug();
if (debugger.isStarted()) {
debugger.stopDebug();
} else {
toolbar.activateStop();
@@ -1209,7 +1210,7 @@ public class JavaEditor extends Editor {
@Override
public void toggleBreakpoint(int lineIndex) {
getDebugger().toggleBreakpoint(lineIndex);
debugger.toggleBreakpoint(lineIndex);
}
@@ -1221,15 +1222,14 @@ public class JavaEditor extends Editor {
boolean saved = super.handleSaveAs();
if (saved) {
// re-set breakpoints in first tab (name has changed)
Debugger targetDebugger = getDebugger();
List<LineBreakpoint> bps = targetDebugger.getBreakpoints(oldName);
targetDebugger.clearBreakpoints(oldName);
List<LineBreakpoint> bps = debugger.getBreakpoints(oldName);
debugger.clearBreakpoints(oldName);
String newName = getSketch().getCode(0).getFileName();
//System.out.println("new name: " + newName);
for (LineBreakpoint bp : bps) {
LineID line = new LineID(newName, bp.lineID().lineIdx());
//System.out.println("setting: " + line);
targetDebugger.setBreakpoint(line);
debugger.setBreakpoint(line);
}
// add breakpoint marker comments to source file
for (SketchCode code : getSketch().getCode()) {
@@ -1292,20 +1292,20 @@ public class JavaEditor extends Editor {
@Override
public void librariesChanged() {
getPreprocessingService().notifyLibrariesChanged();
preprocService.notifyLibrariesChanged();
}
@Override
public void codeFolderChanged() {
getPreprocessingService().notifyCodeFolderChanged();
preprocService.notifyCodeFolderChanged();
}
@Override
public void sketchChanged() {
errorChecker.notifySketchChanged();
getPreprocessingService().notifySketchChanged();
preprocService.notifySketchChanged();
}
@@ -1362,17 +1362,11 @@ public class JavaEditor extends Editor {
public void dispose() {
//System.out.println("window dispose");
// quit running debug session
Debugger targetDebugger = getDebugger();
if (targetDebugger.isEnabled()) {
targetDebugger.stopDebug();
if (debugger.isEnabled()) {
debugger.stopDebug();
}
targetDebugger.dispose();
getPreprocessingService().dispose();
debugger = null;
preprocService = null;
debugger.dispose();
preprocService.dispose();
inspect.dispose();
usage.dispose();
@@ -1388,14 +1382,13 @@ public class JavaEditor extends Editor {
@Override
public boolean isDebuggerEnabled() {
return getDebugger().isEnabled();
return debugger.isEnabled();
}
@Override
public JMenu buildModeMenu() {
//return buildDebugMenu();
return getDebugger().buildMenu();
return modeMenu = new JMenu(Language.text("menu.debug"));
}
@@ -1477,7 +1470,7 @@ public class JavaEditor extends Editor {
Messages.loge("Illegal tab name to addBreakpointComments() " + tabFilename);
return;
}
List<LineBreakpoint> bps = getDebugger().getBreakpoints(tab.getFileName());
List<LineBreakpoint> bps = debugger.getBreakpoints(tab.getFileName());
// load the source file
////switched to using methods provided by the SketchCode class
@@ -1545,7 +1538,7 @@ public class JavaEditor extends Editor {
*/
protected void setTabContents(String tabFilename, String code) {
// remove all breakpoints of this tab
getDebugger().clearBreakpoints(tabFilename);
debugger.clearBreakpoints(tabFilename);
SketchCode currentTab = getCurrentTab();
@@ -1618,9 +1611,6 @@ public class JavaEditor extends Editor {
public Debugger getDebugger() {
if (debugger == null) {
debugger = new Debugger(this);
}
return debugger;
}
@@ -1635,9 +1625,6 @@ public class JavaEditor extends Editor {
public PreprocService getPreprocessingService() {
if (preprocService == null) {
preprocService = new PreprocService(this);
}
return preprocService;
}
@@ -1651,7 +1638,7 @@ public class JavaEditor extends Editor {
autoSave();
super.prepareRun();
downloadImports();
getPreprocessingService().cancel();
preprocService.cancel();
}
@@ -1823,7 +1810,7 @@ public class JavaEditor extends Editor {
public void activateRun() {
getDebugger().enableMenuItem(false);
debugger.enableMenuItem(false);
toolbar.activateRun();
}
@@ -1836,7 +1823,7 @@ public class JavaEditor extends Editor {
*/
public void deactivateRun() {
toolbar.deactivateRun();
getDebugger().enableMenuItem(true);
debugger.enableMenuItem(true);
}
@@ -1875,7 +1862,6 @@ public class JavaEditor extends Editor {
public void toggleDebug() {
// debugEnabled = !debugEnabled;
getDebugger().toggleEnabled();
rebuildToolbar();
repaint(); // show/hide breakpoints in the gutter
@@ -2110,10 +2096,8 @@ public class JavaEditor extends Editor {
}
}
}
Debugger targetDebugger = getDebugger();
if (targetDebugger.isStarted()) {
targetDebugger.startTrackingLineChanges();
if (getDebugger() != null && getDebugger().isStarted()) {
getDebugger().startTrackingLineChanges();
}
if (errorColumn != null) {
errorColumn.repaint();

View File

@@ -37,24 +37,33 @@ import processing.mode.java.debug.Debugger;
public class JavaToolbar extends EditorToolbar {
JavaEditor jeditor;
// boolean debug; // true if this is the expanded debug feller
EditorButton stepButton;
EditorButton continueButton;
// public JavaToolbar(Editor editor, boolean debug) {
public JavaToolbar(Editor editor) {
super(editor);
// this.debug = debug;
jeditor = (JavaEditor) editor;
}
/**
* Check if 'debugger' is available and enabled.
*/
private boolean isDebuggerArmed() {
// 'jeditor' not ready yet because this is called by super()
// 'debugger' also null during init
if (jeditor == null) {
return false;
}
return jeditor.isDebuggerEnabled();
}
@Override
public List<EditorButton> createButtons() {
// jeditor not ready yet because this is called by super()
final boolean debug = ((JavaEditor) editor).isDebuggerEnabled();
// System.out.println("creating buttons in JavaToolbar, debug:" + debug);
final boolean debug = isDebuggerArmed();
List<EditorButton> outgoing = new ArrayList<>();
final String runText = debug ?
@@ -130,10 +139,9 @@ public class JavaToolbar extends EditorToolbar {
}
};
if (((JavaEditor) editor).isDebuggerEnabled()) {
if (isDebuggerArmed()) {
debugButton.setSelected(true);
}
// debugButton.setRolloverLabel(label);
box.add(debugButton);
addGap(box);
}

View File

@@ -117,12 +117,9 @@ public class Debugger {
/**
* Creates the debug menu. Includes ActionListeners for the menu items.
* Intended for adding to the menu bar.
*
* @return The debug menu
*/
public JMenu buildMenu() {
debugMenu = new JMenu(Language.text("menu.debug"));
public void populateMenu(JMenu modeMenu) {
debugMenu = modeMenu;
JMenuItem item;
debugItem = Toolkit.newJMenuItem(Language.text("menu.debug.enable"), 'D');
@@ -188,8 +185,6 @@ public class Debugger {
});
debugMenu.add(item);
item.setEnabled(false);
return debugMenu;
}
@@ -203,7 +198,7 @@ public class Debugger {
}
public void toggleEnabled() {
void toggleEnabled() {
enabled = !enabled;
if (enabled) {

View File

@@ -1,6 +1,5 @@
package processing.mode.java.preproc.issue;
import processing.mode.java.preproc.issue.PdePreprocessIssue;
public class PdePreprocessIssueException extends RuntimeException {