PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR},
//$NON-NLS-1$
{PreferencesMessages.getString("PHPEditorPreferencePage.tags"),
- PreferenceConstants.EDITOR_JAVA_TAG_COLOR},
+ PreferenceConstants.EDITOR_PHP_TAG_COLOR},
//$NON-NLS-1$
{PreferencesMessages.getString("PHPEditorPreferencePage.keywords"),
PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR},
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.BOOLEAN,
PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD));
- overlayKeys
- .add(new OverlayPreferenceStore.OverlayKey(
+
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.STRING,
+ PreferenceConstants.EDITOR_PHP_TAG_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.BOOLEAN,
+ PreferenceConstants.EDITOR_PHP_TAG_BOLD));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.STRING,
+ PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.BOOLEAN,
+ PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_BOLD));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.STRING,
+ PreferenceConstants.EDITOR_PHP_VARIABLE_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.BOOLEAN,
+ PreferenceConstants.EDITOR_PHP_VARIABLE_BOLD));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.STRING,
+ PreferenceConstants.EDITOR_PHP_CONSTANT_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.BOOLEAN,
+ PreferenceConstants.EDITOR_PHP_CONSTANT_BOLD));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.STRING,
+ PreferenceConstants.EDITOR_PHP_TYPE_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
+ OverlayPreferenceStore.BOOLEAN,
+ PreferenceConstants.EDITOR_PHP_TYPE_BOLD));
+
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.STRING,
PreferenceConstants.EDITOR_STRING_COLOR));
- overlayKeys
- .add(new OverlayPreferenceStore.OverlayKey(
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.BOOLEAN,
PreferenceConstants.EDITOR_STRING_BOLD));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR},
//$NON-NLS-1$
{PHPUIMessages.getString("PHPEditorPreferencePage.tags"),
- PreferenceConstants.EDITOR_JAVA_TAG_COLOR},
+ PreferenceConstants.EDITOR_PHP_TAG_COLOR},
//$NON-NLS-1$
{PHPUIMessages.getString("PHPEditorPreferencePage.keywords"),
PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR},
private OverlayKey[] createKeys() {
ArrayList overlayKeys= new ArrayList();
- overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_JAVADOC));
+// overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_JAVADOC));
// overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_INNERTYPES));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_METHODS));
// overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FOLDING_IMPORTS));
Label label= new Label(inner, SWT.LEFT);
label.setText(FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.title")); //$NON-NLS-1$
- addCheckBox(inner, FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.comments"), PreferenceConstants.EDITOR_FOLDING_JAVADOC, 0); //$NON-NLS-1$
+// addCheckBox(inner, FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.comments"), PreferenceConstants.EDITOR_FOLDING_JAVADOC, 0); //$NON-NLS-1$
// addCheckBox(inner, FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.innerTypes"), PreferenceConstants.EDITOR_FOLDING_INNERTYPES, 0); //$NON-NLS-1$
addCheckBox(inner, FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.methods"), PreferenceConstants.EDITOR_FOLDING_METHODS, 0); //$NON-NLS-1$
// addCheckBox(inner, FoldingMessages.getString("DefaultJavaFoldingPreferenceBlock.imports"), PreferenceConstants.EDITOR_FOLDING_IMPORTS, 0); //$NON-NLS-1$
* @see org.eclipse.jface.resource.StringConverter
* @see org.eclipse.jface.preference.PreferenceConverter
*/
- public final static String EDITOR_JAVA_TAG_COLOR = IPreferenceConstants.PHP_TAG;
+ public final static String EDITOR_PHP_TAG_COLOR = IPreferenceConstants.PHP_TAG;
/**
* A named preference that controls whether php start and stop tags are rendered in bold.
* Value is of type <code>Boolean</code>.
* </p>
*/
- public final static String EDITOR_JAVA_TAG_BOLD = IPreferenceConstants.PHP_TAG + EDITOR_BOLD_SUFFIX;
+ public final static String EDITOR_PHP_TAG_BOLD = IPreferenceConstants.PHP_TAG + EDITOR_BOLD_SUFFIX;
/**
* A named preference that holds the color used to render php keywords.
PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR, new RGB(63, 127, 95));
store.setDefault(PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD, false);
- PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_JAVA_TAG_COLOR, new RGB(255, 0, 128));
- store.setDefault(PreferenceConstants.EDITOR_JAVA_TAG_BOLD, true);
+ PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_PHP_TAG_COLOR, new RGB(255, 0, 128));
+ store.setDefault(PreferenceConstants.EDITOR_PHP_TAG_BOLD, true);
PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR, new RGB(127, 0, 85));
store.setDefault(PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD, true);
// folding
store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true);
- store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, "org.eclipse.jdt.ui.text.defaultFoldingProvider"); //$NON-NLS-1$
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, "net.sourceforge.phpdt.ui.text.defaultFoldingProvider"); //$NON-NLS-1$
store.setDefault(PreferenceConstants.EDITOR_FOLDING_JAVADOC, false);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, true);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
- store.setDefault(PreferenceConstants.EDITOR_FOLDING_IMPORTS, true);
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_IMPORTS, false);
// do more complicated stuff
// NewJavaProjectPreferencePage.initDefaults(store);
* (value <code>"__php_operator"</code>).
* @since 3.0
*/
- public static final String PHP_OPERATOR= "__php_operator"; //$NON-NLS-1$
+ public static final String PHP_OPERATOR = "__php_operator"; //$NON-NLS-1$
/**
* A named preference that holds the color used to render operators and brackets.
* <p>
int character= scanner.read();
if (isOperator((char) character)) {
+ int lastCharacter = character;
+ character= scanner.read();
+ if (!isOperator((char) character)) {
+ scanner.unread();
+ return fToken;
+ }
+ if (lastCharacter=='<' && character=='?') {
+ scanner.unread();
+ scanner.unread();
+ return Token.UNDEFINED;
+ }
+ if (lastCharacter=='?' && character=='>') {
+ scanner.unread();
+ scanner.unread();
+ return Token.UNDEFINED;
+ }
do {
character= scanner.read();
} while (isOperator((char) character));
c = scanner.read();
if (c != '?') {
scanner.unread();
+ scanner.unread();
+ return Token.UNDEFINED;
} else {
c = scanner.read();
if (c != 'p') {
scanner.unread();
+ return getToken(IPreferenceConstants.PHP_TAG);
} else {
c = scanner.read();
if (c != 'h') {
scanner.unread();
+ scanner.unread();
+ return getToken(IPreferenceConstants.PHP_TAG);
} else {
c = scanner.read();
if (c != 'p') {
scanner.unread();
+ scanner.unread();
+ scanner.unread();
+ return getToken(IPreferenceConstants.PHP_TAG);
} else {
return getToken(IPreferenceConstants.PHP_TAG);
}
}
}
}
-
}
if (c == '?') {
- c = scanner.read();
+ c = scanner.read();
if (c == '>') {
return getToken(IPreferenceConstants.PHP_TAG);
- }
+ }
scanner.unread();
+ scanner.unread();
+ return Token.UNDEFINED;
}
if (fDetector.isWordStart((char) c)) {
if (c == '$') {
rules.add(new MultiLineRule("\"", "\"", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
rules.add(new MultiLineRule("`", "`", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
rules.add(new MultiLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
-
-// Add rule for operators and brackets
- token= getToken(IPreferenceConstants.PHP_OPERATOR);
- rules.add(new OperatorRule(token));
token = getToken(IPreferenceConstants.PHP_MULTILINE_COMMENT);
rules.add(new MultiLineRule("/*", "*/", token)); //$NON-NLS-2$ //$NON-NLS-1$
// Add word rule for keywords, types, and constants.
token = getToken(IPreferenceConstants.PHP_DEFAULT);
PHPWordRule wordRule = new PHPWordRule(new PHPWordDetector(), token);
- CombinedWordRule combinedWordRule= new CombinedWordRule(new PHPWordDetector(), token);
Token keyword = getToken(IPreferenceConstants.PHP_KEYWORD);
Token functionName = getToken(IPreferenceConstants.PHP_FUNCTIONNAME);
elbuffer = (PHPElement) buffer.get(i);
if (elbuffer instanceof PHPKeyword) {
name = ((PHPKeyword) elbuffer).getName();
-// if (!name.equals("return")) {
+ if (!name.equals("return")) {
wordRule.addWord(name, keyword);
-// }
+ }
} else if (elbuffer instanceof PHPFunction) {
wordRule.addWord(((PHPFunction) elbuffer).getName(), functionName);
} else if (elbuffer instanceof PHPType) {
wordRule.addWord(elbuffer.getName(), constant);
}
}
+
+// Add word rule for keyword 'return'.
+ token= getToken(IPreferenceConstants.PHP_KEYWORD_RETURN);
+ wordRule.addWord("return", token);
+
+// Add rule for operators and brackets (at the end !)
+ token= getToken(IPreferenceConstants.PHP_OPERATOR);
+ rules.add(new OperatorRule(token));
+
rules.add(wordRule);
-// Add word rule for keyword 'return'.
-// CombinedWordRule.WordMatcher returnWordRule= new CombinedWordRule.WordMatcher();
-// token= getToken(IPreferenceConstants.PHP_KEYWORD_RETURN);
-// returnWordRule.addWord("return", token); //$NON-NLS-1$
-// combinedWordRule.addWordMatcher(returnWordRule);
-// rules.add(combinedWordRule);
-//
return rules;
}
}