import net.sourceforge.phpdt.ui.text.JavaTextTools;
import net.sourceforge.phpeclipse.IPreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
-import net.sourceforge.phpeclipse.phpeditor.PHPEditorEnvironment;
import net.sourceforge.phpeclipse.phpeditor.PHPSourceViewerConfiguration;
import net.sourceforge.phpeclipse.preferences.ColorEditor;
-import net.sourceforge.phpeclipse.preferences.PHPPreferencesMessages;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.preference.FileFieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.WorkbenchChainedTextFontFieldEditor;
/*
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MULTI_LINE_COMMENT_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_BOLD),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_TAG_COLOR),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_TAG_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_KEYWORD_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVA_DEFAULT_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_KEYWORD_BOLD),
- new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_JAVADOC_LINKS_BOLD),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_PASTE),
- new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS),
- new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS_PHP),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACES),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_JAVADOCS),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_WRAP_STRINGS),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_FORMAT_JAVADOCS),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_HOME_END),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_STRINGS_HTML),
+ new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_CLOSE_BRACKETS_HTML),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_DEFAULT_HOVER),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_NONE_HOVER),
new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_CTRL_HOVER),
{
PHPUIMessages.getString("PHPEditorPreferencePage.singleLineComment"), PreferenceConstants.EDITOR_SINGLE_LINE_COMMENT_COLOR }, //$NON-NLS-1$
{
+ PHPUIMessages.getString("PHPEditorPreferencePage.tags"), PreferenceConstants.EDITOR_JAVA_TAG_COLOR }, //$NON-NLS-1$
+ {
PHPUIMessages.getString("PHPEditorPreferencePage.keywords"), PreferenceConstants.EDITOR_JAVA_KEYWORD_COLOR }, //$NON-NLS-1$
{
PHPUIMessages.getString("PHPEditorPreferencePage.functionNames"), PreferenceConstants.EDITOR_PHP_FUNCTIONNAME_COLOR }, //$NON-NLS-1$
{
PHPUIMessages.getString("PHPEditorPreferencePage.phpDocKeywords"), PreferenceConstants.EDITOR_JAVADOC_KEYWORD_COLOR }, //$NON-NLS-1$
{
- PHPUIMessages.getString("PHPEditorPreferencePage.phpDocHtmlTags"), PreferenceConstants.EDITOR_JAVADOC_TAG_BOLD }, //$NON-NLS-1$
+ PHPUIMessages.getString("PHPEditorPreferencePage.phpDocHtmlTags"), PreferenceConstants.EDITOR_JAVADOC_TAG_COLOR }, //$NON-NLS-1$
{
PHPUIMessages.getString("PHPEditorPreferencePage.phpDocLinks"), PreferenceConstants.EDITOR_JAVADOC_LINKS_COLOR }, //$NON-NLS-1$
{
private Button fBackgroundCustomRadioButton;
private Button fBackgroundColorButton;
private Button fBoldCheckBox;
- // private Button fAddJavaDocTagsButton;
- private Button fGuessMethodArgumentsButton;
+ //private Button fAddJavaDocTagsButton;
+ // private Button fGuessMethodArgumentsButton;
private SourceViewer fPreviewViewer;
private Color fBackgroundColor;
private Control fAutoInsertDelayText;
String content = loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); //$NON-NLS-1$
IDocument document = new Document(content);
- PHPEditorEnvironment pe;
+ // PHPEditorEnvironment pe;
IDocumentPartitioner partitioner = fJavaTextTools.createDocumentPartitioner();
partitioner.connect(document);
document.setDocumentPartitioner(partitioner);
appearanceComposite.setLayout(layout);
String label = PHPUIMessages.getString("PHPEditorPreferencePage.textFont"); //$NON-NLS-1$
- addTextFontEditor(appearanceComposite, label, AbstractTextEditor.PREFERENCE_FONT);
+ addTextFontEditor(appearanceComposite, label, JFaceResources.TEXT_FONT);
label = PHPUIMessages.getString("PHPEditorPreferencePage.displayedTabWidth"); //$NON-NLS-1$
addTextField(appearanceComposite, label, PreferenceConstants.EDITOR_TAB_WIDTH, 3, 0, true);
layout.numColumns = 2;
composite.setLayout(layout);
- String text = "Analyse &problems while typing";
- addCheckBox(composite, text, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, 0);
-
- text = PHPUIMessages.getString("PHPEditorPreferencePage.showQuickFixables"); //$NON-NLS-1$
- addCheckBox(composite, text, PreferenceConstants.EDITOR_CORRECTION_INDICATION, 0);
+// String text = "Analyse &problems while typing";
+// addCheckBox(composite, text, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS, 0);
+//
+// text = PHPUIMessages.getString("PHPEditorPreferencePage.showQuickFixables"); //$NON-NLS-1$
+// addCheckBox(composite, text, PreferenceConstants.EDITOR_CORRECTION_INDICATION, 0);
Label label = new Label(composite, SWT.LEFT);
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
return composite;
}
- // private Control createBehaviourPage(Composite parent) {
- // Composite composite= new Composite(parent, SWT.NULL);
- // GridLayout layout= new GridLayout(); layout.numColumns= 2;
- // composite.setLayout(layout);
- //
- // String label= PHPUIMessages.getString("PHPEditorPreferencePage.wrapStrings"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_WRAP_STRINGS, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartHomeEnd"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_HOME_END, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.smartPaste"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_PASTE, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.insertSpaceForTabs"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_SPACES_FOR_TABS, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStrings"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBrackets"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBraces"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.closePHPDocs"); //$NON-NLS-1$
- // Button button= addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_JAVADOCS, 1);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.addPHPDocTags"); //$NON-NLS-1$
- // fAddJavaDocTagsButton= addCheckBox(composite, label, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, 1);
- // createDependency(button, fAddJavaDocTagsButton);
- //
- // label= PHPUIMessages.getString("PHPEditorPreferencePage.formatPHPDocs"); //$NON-NLS-1$
- // addCheckBox(composite, label, PreferenceConstants.EDITOR_FORMAT_JAVADOCS, 1);
- //
- // return composite;
- // }
+ private Control createBehaviourPage(Composite parent) {
+ Composite composite= new Composite(parent, SWT.NULL);
+ GridLayout layout= new GridLayout(); layout.numColumns= 2;
+ composite.setLayout(layout);
+ String label;
+// String label= PHPUIMessages.getString("PHPEditorPreferencePage.wrapStrings"); //$NON-NLS-1$
+// addCheckBox(composite, label, PreferenceConstants.EDITOR_WRAP_STRINGS, 1);
+
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.smartHomeEnd"); //$NON-NLS-1$
+// addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_HOME_END, 1);
+//
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.smartPaste"); //$NON-NLS-1$
+// addCheckBox(composite, label, PreferenceConstants.EDITOR_SMART_PASTE, 1);
+
+ label= PHPUIMessages.getString("PHPEditorPreferencePage.insertSpaceForTabs"); //$NON-NLS-1$
+ addCheckBox(composite, label, PreferenceConstants.EDITOR_SPACES_FOR_TABS, 1);
+
+ label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStringsPHP"); //$NON-NLS-1$
+ addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS_PHP, 1);
+
+ label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBracketsPHP"); //$NON-NLS-1$
+ addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS_PHP, 1);
+
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBraces"); //$NON-NLS-1$
+// addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACES, 1);
+//
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.closePHPDocs"); //$NON-NLS-1$
+// Button button= addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_JAVADOCS, 1);
+//
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.addPHPDocTags"); //$NON-NLS-1$
+// fAddJavaDocTagsButton= addCheckBox(composite, label, PreferenceConstants.EDITOR_ADD_JAVADOC_TAGS, 1);
+// createDependency(button, fAddJavaDocTagsButton);
+
+// label= PHPUIMessages.getString("PHPEditorPreferencePage.formatPHPDocs"); //$NON-NLS-1$
+// addCheckBox(composite, label, PreferenceConstants.EDITOR_FORMAT_JAVADOCS, 1);
+//
+ label= PHPUIMessages.getString("PHPEditorPreferencePage.closeStringsHTML"); //$NON-NLS-1$
+ addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_STRINGS_HTML, 1);
+
+ label= PHPUIMessages.getString("PHPEditorPreferencePage.closeBracketsHTML"); //$NON-NLS-1$
+ addCheckBox(composite, label, PreferenceConstants.EDITOR_CLOSE_BRACKETS_HTML, 1);
+ return composite;
+ }
private static void indent(Control control) {
GridData gridData = new GridData();
GridLayout layout = new GridLayout();
layout.numColumns = 2;
contentAssistComposite.setLayout(layout);
-
- String label = PHPUIMessages.getString("PHPEditorPreferencePage.insertSingleProposalsAutomatically"); //$NON-NLS-1$
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOINSERT, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext"); //$NON-NLS-1$
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.presentProposalsInAlphabeticalOrder"); //$NON-NLS-1$
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName"); //$NON-NLS-1$
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ADDIMPORT, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.insertCompletion"); //$NON-NLS-1$
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_INSERT_COMPLETION, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.fillArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
- Button button = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, 0);
-
- label = PHPUIMessages.getString("PHPEditorPreferencePage.guessArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
- fGuessMethodArgumentsButton =
- addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, 0);
- createDependency(button, fGuessMethodArgumentsButton);
+ String label;
+// String label = PHPUIMessages.getString("PHPEditorPreferencePage.insertSingleProposalsAutomatically"); //$NON-NLS-1$
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOINSERT, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.showOnlyProposalsVisibleInTheInvocationContext"); //$NON-NLS-1$
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.presentProposalsInAlphabeticalOrder"); //$NON-NLS-1$
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ORDER_PROPOSALS, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.automaticallyAddImportInsteadOfQualifiedName"); //$NON-NLS-1$
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_ADDIMPORT, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.insertCompletion"); //$NON-NLS-1$
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_INSERT_COMPLETION, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.fillArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
+// Button button = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES, 0);
+//
+// label = PHPUIMessages.getString("PHPEditorPreferencePage.guessArgumentNamesOnMethodCompletion"); //$NON-NLS-1$
+// fGuessMethodArgumentsButton =
+// addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_GUESS_METHOD_ARGUMENTS, 0);
+// createDependency(button, fGuessMethodArgumentsButton);
label = PHPUIMessages.getString("PHPEditorPreferencePage.enableAutoActivation"); //$NON-NLS-1$
final Button autoactivation = addCheckBox(contentAssistComposite, label, PreferenceConstants.CODEASSIST_AUTOACTIVATION, 0);
item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.problemIndicationTab.title")); //$NON-NLS-1$
item.setControl(createProblemIndicationPage(folder));
- // item= new TabItem(folder, SWT.NONE);
- // item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.behaviourTab.title")); //$NON-NLS-1$
- // item.setControl(createBehaviourPage(folder));
+ item= new TabItem(folder, SWT.NONE);
+ item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.behaviourTab.title")); //$NON-NLS-1$
+ item.setControl(createBehaviourPage(folder));
// item= new TabItem(folder, SWT.NONE);
// item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.hoverTab.title")); //$NON-NLS-1$
fBackgroundCustomRadioButton.setSelection(!default_);
fBackgroundColorButton.setEnabled(!default_);
- // boolean closeJavaDocs= fOverlayStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS);
- // fAddJavaDocTagsButton.setEnabled(closeJavaDocs);
+// boolean closeJavaDocs= fOverlayStore.getBoolean(PreferenceConstants.EDITOR_CLOSE_JAVADOCS);
+// fAddJavaDocTagsButton.setEnabled(closeJavaDocs);
- boolean fillMethodArguments = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES);
- fGuessMethodArgumentsButton.setEnabled(fillMethodArguments);
+// boolean fillMethodArguments = fOverlayStore.getBoolean(PreferenceConstants.CODEASSIST_FILL_ARGUMENT_NAMES);
+// fGuessMethodArgumentsButton.setEnabled(fillMethodArguments);
updateAutoactivationControls();