import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+
import net.sourceforge.phpdt.core.JavaCore;
import net.sourceforge.phpdt.internal.ui.PHPUIMessages;
import net.sourceforge.phpdt.internal.ui.dialogs.StatusInfo;
import net.sourceforge.phpdt.internal.ui.dialogs.StatusUtil;
+import net.sourceforge.phpdt.internal.ui.text.IPHPPartitions;
import net.sourceforge.phpdt.internal.ui.util.TabFolderLayout;
import net.sourceforge.phpdt.ui.PreferenceConstants;
import net.sourceforge.phpdt.ui.text.JavaTextTools;
+import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
import net.sourceforge.phpeclipse.IPreferenceConstants;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
-import net.sourceforge.phpeclipse.phpeditor.PHPSourceViewerConfiguration;
import net.sourceforge.phpeclipse.preferences.ColorEditor;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.jface.preference.IPreferenceStore;
IWorkbenchPreferencePage {
private static final String BOLD = PreferenceConstants.EDITOR_BOLD_SUFFIX;
private static final String COMPILER_TASK_TAGS = JavaCore.COMPILER_TASK_TAGS;
- // public final OverlayPreferenceStore.OverlayKey[] fKeys =
- // new OverlayPreferenceStore.OverlayKey[] {
+// public final OverlayPreferenceStore.OverlayKey[] fKeys =
+// new OverlayPreferenceStore.OverlayKey[] {
// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
// PreferenceConstants.EDITOR_FOREGROUND_COLOR),
// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
// PreferenceConstants.EDITOR_LINE_NUMBER_RULER),
// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
// PreferenceConstants.EDITOR_SPACES_FOR_TABS),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_AUTOACTIVATION),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT,
- // PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_AUTOINSERT),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND),
- // new OverlayPreferenceStore.OverlayKey(
- // OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA),
- // new OverlayPreferenceStore.OverlayKey(
- // OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC),
- // new OverlayPreferenceStore.OverlayKey(
- // OverlayPreferenceStore.STRING,
- // PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_ORDER_PROPOSALS),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_CASE_SENSITIVITY),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_ADDIMPORT),
- // new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.CODEASSIST_INSERT_COMPLETION),
- // 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.CODEASSIST_AUTOACTIVATION),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.INT,
+// PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_AUTOINSERT),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_REPLACEMENT_BACKGROUND),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_REPLACEMENT_FOREGROUND),
+// new OverlayPreferenceStore.OverlayKey(
+// OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVA),
+// new OverlayPreferenceStore.OverlayKey(
+// OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_JAVADOC),
+// new OverlayPreferenceStore.OverlayKey(
+// OverlayPreferenceStore.STRING,
+// PreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS_HTML),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_SHOW_VISIBLE_PROPOSALS),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_ORDER_PROPOSALS),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_CASE_SENSITIVITY),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_ADDIMPORT),
+// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.CODEASSIST_INSERT_COMPLETION),
+// 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.STRING,
// PreferenceConstants.EDITOR_CTRL_SHIFT_HOVER),
// new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING,
// PreferenceConstants.EDITOR_ALT_SHIFT_HOVER),
- // };
+// };
/** The keys of the overlay store. */
public final OverlayPreferenceStore.OverlayKey[] fKeys;
private final String[][] fSyntaxColorListModel = new String[][]{
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},
.getString("JavaEditorPreferencePage.AnnotationDecoration.NONE"),
AnnotationPreference.STYLE_NONE},
//$NON-NLS-1$
- {
- PreferencesMessages
- .getString("JavaEditorPreferencePage.AnnotationDecoration.SQUIGGLIES"),
- AnnotationPreference.STYLE_SQUIGGLIES},
+// {
+// PreferencesMessages
+// .getString("JavaEditorPreferencePage.AnnotationDecoration.SQUIGGLIES"),
+// AnnotationPreference.STYLE_SQUIGGLIES},
//$NON-NLS-1$
{
PreferencesMessages
OverlayPreferenceStore.BOOLEAN,
PreferenceConstants.CODEASSIST_AUTOINSERT));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
- OverlayPreferenceStore.STRING,
+ OverlayPreferenceStore.STRING,
PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.STRING,
.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.BOOLEAN,
PreferenceConstants.EDITOR_SMART_PASTE));
- // overlayKeys.add(new
- // OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.EDITOR_CLOSE_STRINGS));
- // overlayKeys.add(new
- // OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
- // PreferenceConstants.EDITOR_CLOSE_BRACKETS));
+// overlayKeys.add(new
+// OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.EDITOR_CLOSE_STRINGS));
+// overlayKeys.add(new
+// OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN,
+// PreferenceConstants.EDITOR_CLOSE_BRACKETS));
overlayKeys
.add(new OverlayPreferenceStore.OverlayKey(
OverlayPreferenceStore.BOOLEAN,
fPreviewViewer = new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL
| SWT.BORDER);
fPreviewViewer.configure(new PHPSourceViewerConfiguration(fJavaTextTools,
- null));
+ null, IPHPPartitions.PHP_PARTITIONING));
fPreviewViewer.getTextWidget().setFont(
JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT));
fPreviewViewer.setEditable(false);
PreferenceConstants.EDITOR_CLOSE_BRACKETS_HTML, 1);
return composite;
}
+
private static void indent(Control control) {
GridData gridData = new GridData();
gridData.horizontalIndent = 20;
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
+ initializeDefaultColors();
fOverlayStore.load();
fOverlayStore.start();
TabFolder folder = new TabFolder(parent, 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$
- // fJavaEditorHoverConfigurationBlock= new
- // JavaEditorHoverConfigurationBlock(fOverlayStore);
- // item.setControl(fJavaEditorHoverConfigurationBlock.createControl(folder));
+ item= new TabItem(folder, SWT.NONE);
+ item.setText(PHPUIMessages.getString("PHPEditorPreferencePage.hoverTab.title"));
+ //$NON-NLS-1$
+// fJavaEditorHoverConfigurationBlock= new
+// JavaEditorHoverConfigurationBlock(fOverlayStore);
+// item.setControl(fJavaEditorHoverConfigurationBlock.createControl(folder));
initialize();
return folder;
}
}
}
});
- // for (int i= 0; i < fContentAssistColorListModel.length; i++)
- // fContentAssistColorList.add(fContentAssistColorListModel[i][0]);
- // fContentAssistColorList.getDisplay().asyncExec(new Runnable() {
- // public void run() {
- // if (fContentAssistColorList != null &&
- // !fContentAssistColorList.isDisposed()) {
- // fContentAssistColorList.select(0);
- // handleContentAssistColorListSelection();
- // }
- // }
- // });
+// for (int i= 0; i < fContentAssistColorListModel.length; i++)
+// fContentAssistColorList.add(fContentAssistColorListModel[i][0]);
+// fContentAssistColorList.getDisplay().asyncExec(new Runnable() {
+// public void run() {
+// if (fContentAssistColorList != null &&
+// !fContentAssistColorList.isDisposed()) {
+// fContentAssistColorList.select(0);
+// handleContentAssistColorListSelection();
+// }
+// }
+// });
}
private void initializeFields() {
Iterator e = fColorButtons.keySet().iterator();
updateAutoactivationControls();
// fJavaEditorHoverConfigurationBlock.initializeFields();
}
+
+ private void initializeDefaultColors() {
+ if (!getPreferenceStore().contains(PreferenceConstants.EDITOR_BACKGROUND_COLOR)) {
+ RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
+ PreferenceConverter.setDefault(fOverlayStore, PreferenceConstants.EDITOR_BACKGROUND_COLOR, rgb);
+ PreferenceConverter.setDefault(getPreferenceStore(), PreferenceConstants.EDITOR_BACKGROUND_COLOR, rgb);
+ }
+ if (!getPreferenceStore().contains(PreferenceConstants.EDITOR_FOREGROUND_COLOR)) {
+ RGB rgb= getControl().getDisplay().getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB();
+ PreferenceConverter.setDefault(fOverlayStore, PreferenceConstants.EDITOR_FOREGROUND_COLOR, rgb);
+ PreferenceConverter.setDefault(getPreferenceStore(), PreferenceConstants.EDITOR_FOREGROUND_COLOR, rgb);
+ }
+ }
+
private void updateAutoactivationControls() {
boolean autoactivation = fOverlayStore
.getBoolean(PreferenceConstants.CODEASSIST_AUTOACTIVATION);