Contributors:
IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
+ www.phpeclipse.de
**********************************************************************/
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.ui.views.tasklist.TaskList;
+
/**
* PHP specific text editor.
*/
if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_DISABLE_OVERWRITE_MODE))
enableOverwriteMode(false);
-
+
+ setWordWrap();
// getEditorSite().getShell().addShellListener(fActivationListener);
}
+ private void setWordWrap() {
+ if (getSourceViewer() != null) {
+ getSourceViewer().getTextWidget().setWordWrap(
+ PHPeclipsePlugin.getDefault().getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_WRAP_WORDS));
+ }
+ }
+
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support) {
support.setCharacterPairMatcher(fBracketMatcher);
if (fProjectionModelUpdater != null)
fProjectionModelUpdater.initialize();
-// if (isShowingOverrideIndicators())
-// installOverrideIndicator(false);
+ // if (isShowingOverrideIndicators())
+ // installOverrideIndicator(false);
}
/*
if (value instanceof Integer) {
sourceViewer.getTextWidget().setTabs(((Integer) value).intValue());
} else if (value instanceof String) {
- sourceViewer.getTextWidget().setTabs(Integer.parseInt((String) value));
+ try {
+ sourceViewer.getTextWidget().setTabs(Integer.parseInt((String) value));
+ } catch (NumberFormatException e){
+ // bug #1038071 - set default tab:
+ sourceViewer.getTextWidget().setTabs(80);
+ }
}
return;
}
.getNewValue())))
sourceViewer.invalidateTextPresentation();
}
+ if (PreferenceConstants.EDITOR_WRAP_WORDS.equals(event.getProperty())) {
+ setWordWrap();
+ }
}
/**
}
protected void uninstallOverrideIndicator() {
-// if (fOverrideIndicatorManager != null) {
-// fOverrideIndicatorManager.removeAnnotations();
-// fOverrideIndicatorManager= null;
-// }
+ // if (fOverrideIndicatorManager != null) {
+ // fOverrideIndicatorManager.removeAnnotations();
+ // fOverrideIndicatorManager= null;
+ // }
}
protected void installOverrideIndicator(boolean waitForReconcilation) {
- uninstallOverrideIndicator();
- IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput());
- final IJavaElement inputElement= getInputJavaElement();
-
- if (model == null || inputElement == null)
- return;
-
-// fOverrideIndicatorManager= new OverrideIndicatorManager(model, inputElement, null);
-//
-// if (provideAST) {
-// Job job= new Job(JavaEditorMessages.getString("OverrideIndicatorManager.intallJob")) { //$NON-NLS-1$
-// /*
-// * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
-// * @since 3.0
-// */
-// protected IStatus run(IProgressMonitor monitor) {
-// CompilationUnit ast= JavaPlugin.getDefault().getASTProvider().getAST(inputElement, true, null);
-// if (fOverrideIndicatorManager != null) // editor might have been closed in the meanwhile
-// fOverrideIndicatorManager.reconciled(ast, true, monitor);
-// return Status.OK_STATUS;
-// }
-// };
-// job.setPriority(Job.DECORATE);
-// job.setSystem(true);
-// job.schedule();
-// }
- }
-
- /**
- * Tells whether override indicators are shown.
- *
- * @return <code>true</code> if the override indicators are shown
- * @since 3.0
- */
-// protected boolean isShowingOverrideIndicators() {
-// AnnotationPreference preference= getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE);
-// IPreferenceStore store= getPreferenceStore();
-// return getBoolean(store, preference.getHighlightPreferenceKey())
-// || getBoolean(store, preference.getVerticalRulerPreferenceKey())
-// || getBoolean(store, preference.getOverviewRulerPreferenceKey())
-// || getBoolean(store, preference.getTextPreferenceKey());
-// }
+ uninstallOverrideIndicator();
+ IAnnotationModel model = getDocumentProvider().getAnnotationModel(getEditorInput());
+ final IJavaElement inputElement = getInputJavaElement();
+
+ if (model == null || inputElement == null)
+ return;
+
+ // fOverrideIndicatorManager= new OverrideIndicatorManager(model, inputElement, null);
+ //
+ // if (provideAST) {
+ // Job job= new Job(JavaEditorMessages.getString("OverrideIndicatorManager.intallJob")) { //$NON-NLS-1$
+ // /*
+ // * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ // * @since 3.0
+ // */
+ // protected IStatus run(IProgressMonitor monitor) {
+ // CompilationUnit ast= JavaPlugin.getDefault().getASTProvider().getAST(inputElement, true, null);
+ // if (fOverrideIndicatorManager != null) // editor might have been closed in the meanwhile
+ // fOverrideIndicatorManager.reconciled(ast, true, monitor);
+ // return Status.OK_STATUS;
+ // }
+ // };
+ // job.setPriority(Job.DECORATE);
+ // job.setSystem(true);
+ // job.schedule();
+ // }
+ }
+
+ /**
+ * Tells whether override indicators are shown.
+ *
+ * @return <code>true</code> if the override indicators are shown
+ * @since 3.0
+ */
+ // protected boolean isShowingOverrideIndicators() {
+ // AnnotationPreference preference=
+ // getAnnotationPreferenceLookup().getAnnotationPreference(OverrideIndicatorManager.ANNOTATION_TYPE);
+ // IPreferenceStore store= getPreferenceStore();
+ // return getBoolean(store, preference.getHighlightPreferenceKey())
+ // || getBoolean(store, preference.getVerticalRulerPreferenceKey())
+ // || getBoolean(store, preference.getOverviewRulerPreferenceKey())
+ // || getBoolean(store, preference.getTextPreferenceKey());
+ // }
/**
* Returns the boolean preference for the given key.
*