import net.sourceforge.phpdt.ui.PreferenceConstants;
import net.sourceforge.phpdt.ui.actions.GotoMatchingBracketAction;
import net.sourceforge.phpdt.ui.text.JavaTextTools;
+import net.sourceforge.phpdt.ui.text.PHPSourceViewerConfiguration;
import net.sourceforge.phpdt.ui.text.folding.IJavaFoldingStructureProvider;
import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import org.eclipse.ui.editors.text.IEncodingSupport;
import org.eclipse.ui.part.IShowInTargetList;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
-import org.eclipse.ui.texteditor.AnnotationPreference;
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
import org.eclipse.ui.texteditor.DefaultRangeIndicator;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.ui.texteditor.MarkerAnnotation;
import org.eclipse.ui.texteditor.ResourceAction;
+import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
import org.eclipse.ui.texteditor.TextEditorAction;
import org.eclipse.ui.texteditor.TextOperationAction;
import org.eclipse.ui.views.contentoutline.ContentOutline;
* @since 3.0
*/
private IJavaFoldingStructureProvider fProjectionModelUpdater;
-
+ /**
+ * The override and implements indicator manager for this editor.
+ * @since 3.0
+ */
+// protected OverrideIndicatorManager fOverrideIndicatorManager;
/**
* The action group for folding.
*
*/
protected void initializeEditor() {
//jsurfer old code
- JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
- setSourceViewerConfiguration(new PHPSourceViewerConfiguration(textTools, this)); //, IJavaPartitions.JAVA_PARTITIONING));
- setRangeIndicator(new DefaultRangeIndicator());
- // IPreferenceStore store=
- // PHPeclipsePlugin.getDefault().getPreferenceStore();
- // setPreferenceStore(store);
- IPreferenceStore store = createCombinedPreferenceStore(null);
- setPreferenceStore(store);
-
+// JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
+// setSourceViewerConfiguration(new PHPSourceViewerConfiguration(textTools, this, IPHPPartitions.PHP_PARTITIONING)); //, IJavaPartitions.JAVA_PARTITIONING));
+ IPreferenceStore store= createCombinedPreferenceStore(null);
+ setPreferenceStore(store);
+ JavaTextTools textTools= PHPeclipsePlugin.getDefault().getJavaTextTools();
+ setSourceViewerConfiguration(new PHPSourceViewerConfiguration(textTools.getColorManager(), store, this, IPHPPartitions.PHP_PARTITIONING));
// TODO changed in 3.x ?
- if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE))
- fUpdater = new OutlinePageSelectionUpdater();
+// setRangeIndicator(new DefaultRangeIndicator());
+// if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE))
+// fUpdater = new OutlinePageSelectionUpdater();
// jsurfer end
// IPreferenceStore store= createCombinedPreferenceStore(null);
// getEditorSite().getShell().addShellListener(fActivationListener);
}
+ protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
+
+ support.setCharacterPairMatcher(fBracketMatcher);
+ support.setMatchingCharacterPainterPreferenceKeys(MATCHING_BRACKETS, MATCHING_BRACKETS_COLOR);
+
+ super.configureSourceViewerDecorationSupport(support);
+ }
+
/**
* Returns this document's complete text.
*
return;
}
- // if
- // (PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE.equals(property))
- // {
- // if ((event.getNewValue() instanceof Boolean) &&
- // ((Boolean)event.getNewValue()).booleanValue())
- // fEditorSelectionChangedListener.selectionChanged();
- // return;
- // }
+ if (PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE.equals(property)) {
+ if ((event.getNewValue() instanceof Boolean) && ((Boolean)event.getNewValue()).booleanValue())
+ selectionChanged();
+ return;
+ }
if (PreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE.equals(property)) {
if (event.getNewValue() instanceof Boolean) {
// }
// }
// }
+
+ ((PHPSourceViewerConfiguration)getSourceViewerConfiguration()).handlePropertyChangeEvent(event);
+
+// if (affectsOverrideIndicatorAnnotations(event)) {
+// if (isShowingOverrideIndicators()) {
+// if (fOverrideIndicatorManager == null)
+// installOverrideIndicator(true);
+// } else {
+// if (fOverrideIndicatorManager != null)
+// uninstallOverrideIndicator();
+// }
+// return;
+// }
+
if (PreferenceConstants.EDITOR_FOLDING_PROVIDER.equals(property)) {
if (sourceViewer instanceof ProjectionViewer) {
ProjectionViewer projectionViewer = (ProjectionViewer) sourceViewer;
protected final static String MATCHING_BRACKETS_COLOR = PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR;
/** Preference key for highlighting current line */
- protected final static String CURRENT_LINE = PreferenceConstants.EDITOR_CURRENT_LINE;
+// protected final static String CURRENT_LINE = PreferenceConstants.EDITOR_CURRENT_LINE;
/** Preference key for highlight color of current line */
- protected final static String CURRENT_LINE_COLOR = PreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
+// protected final static String CURRENT_LINE_COLOR = PreferenceConstants.EDITOR_CURRENT_LINE_COLOR;
/** Preference key for showing print marging ruler */
- protected final static String PRINT_MARGIN = PreferenceConstants.EDITOR_PRINT_MARGIN;
+// protected final static String PRINT_MARGIN = PreferenceConstants.EDITOR_PRINT_MARGIN;
/** Preference key for print margin ruler color */
- protected final static String PRINT_MARGIN_COLOR = PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
+// protected final static String PRINT_MARGIN_COLOR = PreferenceConstants.EDITOR_PRINT_MARGIN_COLOR;
/** Preference key for print margin ruler column */
- protected final static String PRINT_MARGIN_COLUMN = PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
+// protected final static String PRINT_MARGIN_COLUMN = PreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN;
/** Preference key for error indication */
// protected final static String ERROR_INDICATION =
return viewer;
}
-
+ /*
+ * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent)
+ */
+ protected boolean affectsTextPresentation(PropertyChangeEvent event) {
+ return ((PHPSourceViewerConfiguration)getSourceViewerConfiguration()).affectsTextPresentation(event) || super.affectsTextPresentation(event);
+ }
+//
+// protected boolean affectsTextPresentation(PropertyChangeEvent event) {
+// JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
+// return textTools.affectsBehavior(event);
+// }
/**
* Creates and returns the preference store for this Java editor with the given input.
*
return new ChainedPreferenceStore((IPreferenceStore[]) stores.toArray(new IPreferenceStore[stores.size()]));
}
- /*
- * @see AbstractTextEditor#createSourceViewer(Composite, IVerticalRuler, int)
- */
- // protected ISourceViewer createJavaSourceViewer(Composite parent,
- // IVerticalRuler verticalRuler, IOverviewRuler overviewRuler, boolean
- // isOverviewRulerVisible, int styles) {
- // return new JavaSourceViewer(parent, verticalRuler, getOverviewRuler(),
- // isOverviewRulerVisible(), styles);
- // }
- /*
- * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent)
- */
- protected boolean affectsTextPresentation(PropertyChangeEvent event) {
- JavaTextTools textTools = PHPeclipsePlugin.getDefault().getJavaTextTools();
- return textTools.affectsBehavior(event);
- }
-
/**
* Jumps to the error next according to the given direction.
*/