From: <kp...@us...> - 2010-08-19 10:28:21
|
Revision: 18392 http://jedit.svn.sourceforge.net/jedit/?rev=18392&view=rev Author: kpouer Date: 2010-08-19 10:28:14 +0000 (Thu, 19 Aug 2010) Log Message: ----------- added double dollar check Modified Paths: -------------- plugins/PHPParser/trunk/src/gatchan/phpparser/PHPErrorSource.java plugins/PHPParser/trunk/src/gatchan/phpparser/PHPParserOptionPane.java Modified: plugins/PHPParser/trunk/src/gatchan/phpparser/PHPErrorSource.java =================================================================== --- plugins/PHPParser/trunk/src/gatchan/phpparser/PHPErrorSource.java 2010-08-19 10:25:28 UTC (rev 18391) +++ plugins/PHPParser/trunk/src/gatchan/phpparser/PHPErrorSource.java 2010-08-19 10:28:14 UTC (rev 18392) @@ -1,3 +1,23 @@ +/* + * PHPErrorSource.java - The PHP Parser + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright (C) 2003, 2010 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ package gatchan.phpparser; import errorlist.DefaultErrorSource; @@ -14,93 +34,108 @@ * @author Matthieu Casanova * @version $Id$ */ -public final class PHPErrorSource implements PHPParserListener { +public final class PHPErrorSource implements PHPParserListener +{ - private DefaultErrorSource errorSource; + private DefaultErrorSource errorSource; - private boolean shortOpenTagWarning; - private boolean forEndFor; - private boolean whileEndWhile; - private boolean ifEndIf; - private boolean switchEndSwitch; - private boolean foreachEndForeach; - private boolean unusedParameters; - private boolean variableMayBeUnassigned; - private boolean unnecessaryGlobal; - private boolean caseSemicolon; - private boolean deprecatedVarToken; - private boolean conditionalExpressionCheck; - private boolean methodFieldsNameCheck; - private boolean phpClosingMissing; + private boolean shortOpenTagWarning; + private boolean forEndFor; + private boolean whileEndWhile; + private boolean ifEndIf; + private boolean switchEndSwitch; + private boolean foreachEndForeach; + private boolean unusedParameters; + private boolean variableMayBeUnassigned; + private boolean unnecessaryGlobal; + private boolean caseSemicolon; + private boolean deprecatedVarToken; + private boolean conditionalExpressionCheck; + private boolean methodFieldsNameCheck; + private boolean phpClosingMissing; + private boolean doubleDollar; - /** Instantiate the PHP error source. */ - public PHPErrorSource() { - Log.log(Log.DEBUG, PHPErrorSource.class, "New PHPErrorSource"); - propertiesChanged(); - } + /** + * Instantiate the PHP error source. + */ + public PHPErrorSource() + { + Log.log(Log.DEBUG, PHPErrorSource.class, "New PHPErrorSource"); + propertiesChanged(); + } - public void setErrorSource(DefaultErrorSource errorSource) { - this.errorSource = errorSource; - propertiesChanged(); - } + public void setErrorSource(DefaultErrorSource errorSource) + { + this.errorSource = errorSource; + propertiesChanged(); + } - public void parseError(PHPParseErrorEvent e) { - if (e.getBeginLine() == e.getEndLine()) { - errorSource.addError(ErrorSource.ERROR, - e.getPath(), - e.getBeginLine() - 1, - e.getBeginColumn() - 1, - e.getEndColumn(), - e.getMessage()); - } else { - errorSource.addError(ErrorSource.ERROR, - e.getPath(), - e.getBeginLine() - 1, - e.getBeginColumn() - 1, - e.getBeginColumn(), - e.getMessage()); - } - } + public void parseError(PHPParseErrorEvent e) + { + if (e.getBeginLine() == e.getEndLine()) + { + errorSource.addError(ErrorSource.ERROR, + e.getPath(), + e.getBeginLine() - 1, + e.getBeginColumn() - 1, + e.getEndColumn(), + e.getMessage()); + } + else + { + errorSource.addError(ErrorSource.ERROR, + e.getPath(), + e.getBeginLine() - 1, + e.getBeginColumn() - 1, + e.getBeginColumn(), + e.getMessage()); + } + } - public void parseMessage(PHPParseMessageEvent e) { - if ((!shortOpenTagWarning && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_SHORT_OPEN_TAG) || - (!forEndFor && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_FOR_ENDFOR_TAG) || - (!ifEndIf && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_IF_ENDIF_TAG) || - (!switchEndSwitch && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_SWITCH_ENDSWITCH_TAG) || - (!foreachEndForeach && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_FOREACH_ENDFOREACH_TAG) || - (!unusedParameters && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_UNUSED_PARAMETERS) || - (!variableMayBeUnassigned && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_VARIABLE_MAY_BE_UNASSIGNED) || - (!unnecessaryGlobal && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_UNNECESSARY_GLOBAL) || - (!caseSemicolon && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_CASE_SEMICOLON) || - (!deprecatedVarToken && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_DEPRECATED_VAR_TOKEN) || - (!conditionalExpressionCheck && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_CONDITIONAL_EXPRESSION_CHECK) || - (!methodFieldsNameCheck && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_METHOD_FIELD_WITH_SAME_NAME) || - (!phpClosingMissing && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_PHP_CLOSING_MISSING) || - (!whileEndWhile && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_WHILE_ENDWHILE_TAG)) { - return; - } - errorSource.addError(ErrorSource.WARNING, - e.getPath(), - e.getBeginLine() - 1, - e.getBeginColumn() - 1, - e.getEndColumn(), - e.getMessage()); - } + public void parseMessage(PHPParseMessageEvent e) + { + if ((!shortOpenTagWarning && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_SHORT_OPEN_TAG) || + (!forEndFor && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_FOR_ENDFOR_TAG) || + (!ifEndIf && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_IF_ENDIF_TAG) || + (!switchEndSwitch && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_SWITCH_ENDSWITCH_TAG) || + (!foreachEndForeach && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_FOREACH_ENDFOREACH_TAG) || + (!unusedParameters && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_UNUSED_PARAMETERS) || + (!variableMayBeUnassigned && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_VARIABLE_MAY_BE_UNASSIGNED) || + (!unnecessaryGlobal && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_UNNECESSARY_GLOBAL) || + (!caseSemicolon && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_CASE_SEMICOLON) || + (!deprecatedVarToken && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_DEPRECATED_VAR_TOKEN) || + (!conditionalExpressionCheck && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_CONDITIONAL_EXPRESSION_CHECK) || + (!methodFieldsNameCheck && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_METHOD_FIELD_WITH_SAME_NAME) || + (!phpClosingMissing && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_PHP_CLOSING_MISSING) || + (!doubleDollar && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_DOUBLE_DOLLAR) || + (!whileEndWhile && e.getMessageClass() == PHPParseMessageEvent.MESSAGE_WHILE_ENDWHILE_TAG)) + { + return; + } + errorSource.addError(ErrorSource.WARNING, + e.getPath(), + e.getBeginLine() - 1, + e.getBeginColumn() - 1, + e.getEndColumn(), + e.getMessage()); + } - private void propertiesChanged() { - shortOpenTagWarning = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_SHORT_OPENTAG); - forEndFor = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_FORENDFOR); - ifEndIf = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_IFENDIF); - whileEndWhile = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_WHILEENDWHILE); - switchEndSwitch = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_SWITCHENDSWITCH); - foreachEndForeach = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_FOREACHENDFOREACH); - unusedParameters = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_UNUSED_PARAMETERS); - variableMayBeUnassigned = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED); - unnecessaryGlobal = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_UNNECESSARY_GLOBAL); - caseSemicolon = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_CASE_SEMICOLON); - deprecatedVarToken = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_DEPRECATED_VAR_TOKEN); - conditionalExpressionCheck = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_CONDITIONAL_EXPRESSION_CHECK); - methodFieldsNameCheck = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME); - phpClosingMissing = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_MESSAGE_PHP_CLOSING_MISSING); - } + private void propertiesChanged() + { + shortOpenTagWarning = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_SHORT_OPENTAG); + forEndFor = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_FORENDFOR); + ifEndIf = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_IFENDIF); + whileEndWhile = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_WHILEENDWHILE); + switchEndSwitch = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_SWITCHENDSWITCH); + foreachEndForeach = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_FOREACHENDFOREACH); + unusedParameters = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_UNUSED_PARAMETERS); + variableMayBeUnassigned = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED); + unnecessaryGlobal = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_UNNECESSARY_GLOBAL); + caseSemicolon = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_CASE_SEMICOLON); + deprecatedVarToken = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_DEPRECATED_VAR_TOKEN); + conditionalExpressionCheck = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_CONDITIONAL_EXPRESSION_CHECK); + methodFieldsNameCheck = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME); + phpClosingMissing = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_MESSAGE_PHP_CLOSING_MISSING); + doubleDollar = jEdit.getBooleanProperty(PHPParserOptionPane.PROP_WARN_DOUBLE_DOLLAR); + } } Modified: plugins/PHPParser/trunk/src/gatchan/phpparser/PHPParserOptionPane.java =================================================================== --- plugins/PHPParser/trunk/src/gatchan/phpparser/PHPParserOptionPane.java 2010-08-19 10:25:28 UTC (rev 18391) +++ plugins/PHPParser/trunk/src/gatchan/phpparser/PHPParserOptionPane.java 2010-08-19 10:28:14 UTC (rev 18392) @@ -1,3 +1,23 @@ +/* + * PHPParserOptionPane.java - The PHP Parser + * :tabSize=8:indentSize=8:noTabs=false: + * :folding=explicit:collapseFolds=1: + * + * Copyright (C) 2003, 2010 Matthieu Casanova + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ package gatchan.phpparser; import org.gjt.sp.jedit.AbstractOptionPane; @@ -11,100 +31,118 @@ * @author Matthieu Casanova * @version $Id$ */ -public final class PHPParserOptionPane extends AbstractOptionPane { - private JCheckBox shortOpenTag; - private JCheckBox forEndFor; - private JCheckBox switchEndSwitch; - private JCheckBox ifEndSwitch; - private JCheckBox whileEndWhile; - private JCheckBox foreachEndForeach; +public final class PHPParserOptionPane extends AbstractOptionPane +{ + private JCheckBox shortOpenTag; + private JCheckBox forEndFor; + private JCheckBox switchEndSwitch; + private JCheckBox ifEndSwitch; + private JCheckBox whileEndWhile; + private JCheckBox foreachEndForeach; + private JCheckBox doubleDollarCheck; - private JCheckBox unusedParameter; - private JCheckBox unassignedVariable; - private JCheckBox unnecessaryGlobal; - private JCheckBox caseSemicolon; - private JCheckBox php5Enabled; - private JCheckBox loadOnStartup; - private JCheckBox deprecatedVarToken; - private JCheckBox conditionalExpressionCheck; - private JCheckBox methodFieldsSameName; - private JCheckBox phpClosingMissing; + private JCheckBox unusedParameter; + private JCheckBox unassignedVariable; + private JCheckBox unnecessaryGlobal; + private JCheckBox caseSemicolon; + private JCheckBox php5Enabled; + private JCheckBox loadOnStartup; + private JCheckBox deprecatedVarToken; + private JCheckBox conditionalExpressionCheck; + private JCheckBox methodFieldsSameName; + private JCheckBox phpClosingMissing; - public static final String PROP_PHP5_SUPPORT = "gatchan.phpparser.php5support"; - public static final String PROP_WARN_SHORT_OPENTAG = "gatchan.phpparser.warnings.shortOpenTag"; - public static final String PROP_WARN_FORENDFOR = "gatchan.phpparser.warnings.forEndFor"; - public static final String PROP_WARN_SWITCHENDSWITCH = "gatchan.phpparser.warnings.switchEndSwitch"; - public static final String PROP_WARN_IFENDIF = "gatchan.phpparser.warnings.ifEndSwitch"; - public static final String PROP_WARN_WHILEENDWHILE = "gatchan.phpparser.warnings.whileEndWhile"; - public static final String PROP_WARN_FOREACHENDFOREACH = "gatchan.phpparser.warnings.foreachEndForeach"; - public static final String PROP_WARN_UNUSED_PARAMETERS = "gatchan.phpparser.warnings.methodanalysis.unusedParameters"; - public static final String PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED = "gatchan.phpparser.warnings.methodanalysis.unassignedVariable"; - public static final String PROP_WARN_CASE_SEMICOLON = "gatchan.phpparser.warnings.warnings.caseSemicolon"; - public static final String PROP_WARN_UNNECESSARY_GLOBAL = "gatchan.phpparser.warnings.methodanalysis.unnecessaryGlobal"; - public static final String PROP_WARN_DEPRECATED_VAR_TOKEN = "gatchan.phpparser.warnings.deprecatedphp4.varToken"; - public static final String PROP_WARN_CONDITIONAL_EXPRESSION_CHECK = "gatchan.phpparser.warnings.types.conditionalExpressionCheck"; - public static final String PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME = "gatchan.phpparser.warnings.classes.method_field_same_name"; - public static final String PROP_WARN_MESSAGE_PHP_CLOSING_MISSING = "gatchan.phpparser.warnings.phpclosingmissing"; + public static final String PROP_PHP5_SUPPORT = "gatchan.phpparser.php5support"; + public static final String PROP_WARN_SHORT_OPENTAG = "gatchan.phpparser.warnings.shortOpenTag"; + public static final String PROP_WARN_FORENDFOR = "gatchan.phpparser.warnings.forEndFor"; + public static final String PROP_WARN_SWITCHENDSWITCH = "gatchan.phpparser.warnings.switchEndSwitch"; + public static final String PROP_WARN_IFENDIF = "gatchan.phpparser.warnings.ifEndSwitch"; + public static final String PROP_WARN_WHILEENDWHILE = "gatchan.phpparser.warnings.whileEndWhile"; + public static final String PROP_WARN_FOREACHENDFOREACH = "gatchan.phpparser.warnings.foreachEndForeach"; + public static final String PROP_WARN_UNUSED_PARAMETERS = "gatchan.phpparser.warnings.methodanalysis.unusedParameters"; + public static final String PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED = "gatchan.phpparser.warnings.methodanalysis.unassignedVariable"; + public static final String PROP_WARN_CASE_SEMICOLON = "gatchan.phpparser.warnings.warnings.caseSemicolon"; + public static final String PROP_WARN_UNNECESSARY_GLOBAL = "gatchan.phpparser.warnings.methodanalysis.unnecessaryGlobal"; + public static final String PROP_WARN_DEPRECATED_VAR_TOKEN = "gatchan.phpparser.warnings.deprecatedphp4.varToken"; + public static final String PROP_WARN_CONDITIONAL_EXPRESSION_CHECK = "gatchan.phpparser.warnings.types.conditionalExpressionCheck"; + public static final String PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME = "gatchan.phpparser.warnings.classes.method_field_same_name"; + public static final String PROP_WARN_MESSAGE_PHP_CLOSING_MISSING = "gatchan.phpparser.warnings.phpclosingmissing"; + public static final String PROP_WARN_DOUBLE_DOLLAR = "gatchan.phpparser.warnings.doubledollar"; - /** Instantiate the option pane of the PHP Parser. */ - public PHPParserOptionPane() { - super("gatchan.phpparser.files"); - } + /** + * Instantiate the option pane of the PHP Parser. + */ + public PHPParserOptionPane() + { + super("gatchan.phpparser.files"); + } - /** Initialize the form. This method is automatically called by jEdit */ - protected void _init() { - addComponent(loadOnStartup = new JCheckBox(jEdit.getProperty("options.gatchan.phpparser.loadOnStartup.text"))); - String startupMode = jEdit.getProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate"); - loadOnStartup.setSelected("startup".equals(startupMode)); + /** + * Initialize the form. This method is automatically called by jEdit + */ + protected void _init() + { + addComponent(loadOnStartup = new JCheckBox(jEdit.getProperty("options.gatchan.phpparser.loadOnStartup.text"))); + String startupMode = jEdit.getProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate"); + loadOnStartup.setSelected("startup".equals(startupMode)); - addComponent(php5Enabled = createCheckBox(PROP_PHP5_SUPPORT)); - addComponent(new JLabel("Warnings")); - addComponent(phpClosingMissing = createCheckBox(PROP_WARN_MESSAGE_PHP_CLOSING_MISSING)); - addComponent(deprecatedVarToken = createCheckBox(PROP_WARN_DEPRECATED_VAR_TOKEN)); - addComponent(shortOpenTag = createCheckBox(PROP_WARN_SHORT_OPENTAG)); - addComponent(forEndFor = createCheckBox(PROP_WARN_FORENDFOR)); - addComponent(switchEndSwitch = createCheckBox(PROP_WARN_SWITCHENDSWITCH)); - addComponent(ifEndSwitch = createCheckBox(PROP_WARN_IFENDIF)); - addComponent(whileEndWhile = createCheckBox(PROP_WARN_WHILEENDWHILE)); - addComponent(foreachEndForeach = createCheckBox(PROP_WARN_FOREACHENDFOREACH)); - addComponent(caseSemicolon = createCheckBox(PROP_WARN_CASE_SEMICOLON)); - addComponent(conditionalExpressionCheck = createCheckBox(PROP_WARN_CONDITIONAL_EXPRESSION_CHECK)); - addComponent(new JLabel("Method analysis")); - addComponent(unusedParameter = createCheckBox(PROP_WARN_UNUSED_PARAMETERS)); - addComponent(unassignedVariable = createCheckBox(PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED)); - addComponent(unnecessaryGlobal = createCheckBox(PROP_WARN_UNNECESSARY_GLOBAL)); + addComponent(php5Enabled = createCheckBox(PROP_PHP5_SUPPORT)); + addComponent(new JLabel("Warnings")); + addComponent(phpClosingMissing = createCheckBox(PROP_WARN_MESSAGE_PHP_CLOSING_MISSING)); + addComponent(deprecatedVarToken = createCheckBox(PROP_WARN_DEPRECATED_VAR_TOKEN)); + addComponent(shortOpenTag = createCheckBox(PROP_WARN_SHORT_OPENTAG)); + addComponent(forEndFor = createCheckBox(PROP_WARN_FORENDFOR)); + addComponent(switchEndSwitch = createCheckBox(PROP_WARN_SWITCHENDSWITCH)); + addComponent(ifEndSwitch = createCheckBox(PROP_WARN_IFENDIF)); + addComponent(whileEndWhile = createCheckBox(PROP_WARN_WHILEENDWHILE)); + addComponent(foreachEndForeach = createCheckBox(PROP_WARN_FOREACHENDFOREACH)); + addComponent(caseSemicolon = createCheckBox(PROP_WARN_CASE_SEMICOLON)); + addComponent(conditionalExpressionCheck = createCheckBox(PROP_WARN_CONDITIONAL_EXPRESSION_CHECK)); + addComponent(doubleDollarCheck = createCheckBox(PROP_WARN_DOUBLE_DOLLAR)); + addComponent(new JLabel("Method analysis")); + addComponent(unusedParameter = createCheckBox(PROP_WARN_UNUSED_PARAMETERS)); + addComponent(unassignedVariable = createCheckBox(PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED)); + addComponent(unnecessaryGlobal = createCheckBox(PROP_WARN_UNNECESSARY_GLOBAL)); - addComponent(new JLabel("Class analysis")); - addComponent(methodFieldsSameName = createCheckBox(PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME)); - } + addComponent(new JLabel("Class analysis")); + addComponent(methodFieldsSameName = createCheckBox(PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME)); + } - private static JCheckBox createCheckBox(String property) { - JCheckBox checkbox = new JCheckBox(jEdit.getProperty(property + ".text")); - checkbox.setSelected(jEdit.getBooleanProperty(property)); - return checkbox; - } + private static JCheckBox createCheckBox(String property) + { + JCheckBox checkbox = new JCheckBox(jEdit.getProperty(property + ".text")); + checkbox.setSelected(jEdit.getBooleanProperty(property)); + return checkbox; + } - /** Save the properties. This method is automatically called by jEdit */ - protected void _save() { - if (loadOnStartup.isSelected()) { - jEdit.setProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate", "startup"); - } else { - jEdit.setProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate", "defer"); - } - jEdit.setBooleanProperty(PROP_PHP5_SUPPORT, php5Enabled.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_DEPRECATED_VAR_TOKEN, deprecatedVarToken.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_SHORT_OPENTAG, shortOpenTag.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_FORENDFOR, forEndFor.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_SWITCHENDSWITCH, switchEndSwitch.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_IFENDIF, ifEndSwitch.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_WHILEENDWHILE, whileEndWhile.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_FOREACHENDFOREACH, foreachEndForeach.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_UNUSED_PARAMETERS, unusedParameter.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED, unassignedVariable.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_UNNECESSARY_GLOBAL, unnecessaryGlobal.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_CASE_SEMICOLON, caseSemicolon.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_CONDITIONAL_EXPRESSION_CHECK, conditionalExpressionCheck.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME, methodFieldsSameName.isSelected()); - jEdit.setBooleanProperty(PROP_WARN_MESSAGE_PHP_CLOSING_MISSING, phpClosingMissing.isSelected()); - } + /** + * Save the properties. This method is automatically called by jEdit + */ + protected void _save() + { + if (loadOnStartup.isSelected()) + { + jEdit.setProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate", "startup"); + } + else + { + jEdit.setProperty("plugin.gatchan.phpparser.PHPParserPlugin.activate", "defer"); + } + jEdit.setBooleanProperty(PROP_PHP5_SUPPORT, php5Enabled.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_DEPRECATED_VAR_TOKEN, deprecatedVarToken.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_SHORT_OPENTAG, shortOpenTag.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_FORENDFOR, forEndFor.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_SWITCHENDSWITCH, switchEndSwitch.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_IFENDIF, ifEndSwitch.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_WHILEENDWHILE, whileEndWhile.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_FOREACHENDFOREACH, foreachEndForeach.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_UNUSED_PARAMETERS, unusedParameter.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_VARIABLE_MAY_BE_UNASSIGNED, unassignedVariable.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_UNNECESSARY_GLOBAL, unnecessaryGlobal.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_CASE_SEMICOLON, caseSemicolon.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_CONDITIONAL_EXPRESSION_CHECK, conditionalExpressionCheck.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_MESSAGE_METHOD_FIELD_WITH_SAME_NAME, methodFieldsSameName.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_MESSAGE_PHP_CLOSING_MISSING, phpClosingMissing.isSelected()); + jEdit.setBooleanProperty(PROP_WARN_DOUBLE_DOLLAR, doubleDollarCheck.isSelected()); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |