Permalink
Browse files

Merge pull request #38 from angelozerr/editor-syntax-coloration

Initialize .editorconfig editor to support syntax coloring.
  • Loading branch information...
2 parents 1c99ba6 + 25a7174 commit d258f6c44a7a8017d1a81a9d5624ef3cf738c0c3 @ncjones committed Jun 7, 2016
Showing with 4,582 additions and 73 deletions.
  1. +3 −1 org.eclipse.editorconfig.core/plugin.properties
  2. +10 −1 org.eclipse.editorconfig.core/plugin.xml
  3. +5 −2 org.eclipse.editorconfig.ui/META-INF/MANIFEST.MF
  4. +2 −1 org.eclipse.editorconfig.ui/build.properties
  5. +28 −0 org.eclipse.editorconfig.ui/css/dark/preferencestyle.css
  6. +15 −2 org.eclipse.editorconfig.ui/plugin.properties
  7. +64 −7 org.eclipse.editorconfig.ui/plugin.xml
  8. +0 −53 ...ipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/internal/ui/EditorConfigUIPlugin.java
  9. +390 −0 org.eclipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/PreferenceConstants.java
  10. +1 −1 ...i/src/main/java/org/eclipse/editorconfig/{internal/ui → ui/internal}/EditorActivationHandler.java
  11. +1 −1 .../java/org/eclipse/editorconfig/{internal/ui → ui/internal}/EditorActivationSelectionListener.java
  12. +1 −1 ...rc/main/java/org/eclipse/editorconfig/{internal/ui → ui/internal}/EditorConfigEclipseStartup.java
  13. +1 −1 ...ava/org/eclipse/editorconfig/{internal/ui → ui/internal}/EditorConfigEditorActivationHandler.java
  14. +43 −0 ...se.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/EditorConfigUIMessages.java
  15. +22 −0 ...torconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/EditorConfigUIMessages.properties
  16. +179 −0 ...ipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/EditorConfigUIPlugin.java
  17. +33 −0 ...torconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/IEditorConfigStatusConstants.java
  18. +56 −0 ...itorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/IEditorConfigThemeConstants.java
  19. +210 −0 ...clipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/dialogs/StatusInfo.java
  20. +83 −0 ...clipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/dialogs/StatusUtil.java
  21. +70 −0 ...editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/editor/EditorConfigEditor.java
  22. +33 −0 ...va/org/eclipse/editorconfig/ui/internal/preferences/EditorConfigEditorColorSettingPreviewCode.txt
  23. +2 −2 ...va/org/eclipse/editorconfig/{internal/ui → ui/internal/preferences}/EditorConfigPropertyPage.java
  24. +117 −0 ...in/java/org/eclipse/editorconfig/ui/internal/preferences/EditorConfigUIPreferenceInitializer.java
  25. +54 −0 ...onfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/preferences/EditorPreferencePage.java
  26. +56 −0 ...rconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/preferences/MainPreferencePage.java
  27. +488 −0 ...fig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/preferences/OverlayPreferenceStore.java
  28. +57 −0 ...config.ui/src/main/java/org/eclipse/editorconfig/ui/internal/preferences/PreferencesMessages.java
  29. +37 −0 ....ui/src/main/java/org/eclipse/editorconfig/ui/internal/preferences/PreferencesMessages.properties
  30. +797 −0 .../src/main/java/org/eclipse/editorconfig/ui/internal/preferences/SyntaxColoringPreferencePage.java
  31. +365 −0 ...onfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/AbstractEditorConfigScanner.java
  32. +147 −0 ...orconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigColorManager.java
  33. +40 −0 ...nfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigDocumentProvider.java
  34. +61 −0 ...src/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigDocumentSetupParticipant.java
  35. +121 −0 ...nfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigPartitionScanner.java
  36. +269 −0 ...rc/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigSourceViewerConfiguration.java
  37. +27 −0 ...ig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/EditorConfigWhitespaceDetector.java
  38. +72 −0 ...ig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/LeadingWhitespacePredicateRule.java
  39. +122 −0 ...editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/PropertyValueScanner.java
  40. +119 −0 ...lipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/SectionScanner.java
  41. +55 −0 ...ig.ui/src/main/java/org/eclipse/editorconfig/ui/internal/text/SingleTokenEditorConfigScanner.java
  42. +50 −0 ...rconfig.ui/src/main/java/org/eclipse/editorconfig/ui/text/EditorConfigPresentationReconciler.java
  43. +90 −0 ...eclipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/text/EditorConfigTextTools.java
  44. +59 −0 org.eclipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/text/IColorManager.java
  45. +74 −0 ...e.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/text/IEditorConfigColorConstants.java
  46. +53 −0 ...lipse.editorconfig.ui/src/main/java/org/eclipse/editorconfig/ui/text/IEditorConfigPartitions.java
@@ -19,4 +19,6 @@
# Angelo Zerr <angelo.zerr@gmail.com> - Initial API and implementation
###############################################################################
pluginName=EditorConfig - Core
-providerName=Nathan Jones
+providerName=Nathan Jones
+
+editorconfigName=EditorConfig File
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
-
+
+ <extension point="org.eclipse.core.contenttype.contentTypes">
+ <!-- declares a content type for .editorconfig files -->
+ <content-type id="editorconfigsource" name="%editorconfigName"
+ base-type="org.eclipse.core.runtime.text"
+ priority="high"
+ file-extensions="editorconfig" >
+ </content-type>
+ </extension>
+
</plugin>
@@ -10,6 +10,9 @@ Require-Bundle: org.eclipse.core.resources,
org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.ui.editors,
- org.eclipse.editorconfig.core
+ org.eclipse.editorconfig.core,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jface.text
Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.editorconfig.internal.ui.EditorConfigUIPlugin
+Bundle-Activator: org.eclipse.editorconfig.ui.internal.EditorConfigUIPlugin
+Export-Package: org.eclipse.editorconfig.ui.text
@@ -4,4 +4,5 @@ bin.includes = META-INF/,\
.,\
icons/,\
plugin.xml,\
- plugin.properties
+ plugin.properties,\
+ css/
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2014-2016 Angelo Zerr
+ *
+ * This file is part of "EditorConfig Eclipse".
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * Contributors:
+ * Angelo Zerr <angelo.zerr@gmail.com> - initial .editorconfig editor
+ */
+
+IEclipsePreferences#org-eclipse-editorconfig-ui {
+ preferences:
+ 'ec_coloring_comment=96,139,78'
+ 'ec_coloring_section=206,145,120'
+ 'ec_coloring_assignment=212,212,212'
+ 'ec_coloring_property_key=86,156,214'
+ 'ec_coloring_property_value=212,212,212'
+}
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright 2014 Nathan Jones and others.
+# Copyright 2014-2016 Nathan Jones and others.
#
# This file is part of "EditorConfig Eclipse".
#
@@ -19,4 +19,17 @@
# Angelo Zerr <angelo.zerr@gmail.com> - Initial API and implementation
###############################################################################
pluginName=EditorConfig - UI
-providerName=Nathan Jones
+providerName=Nathan Jones
+
+EditorConfigEditor.name=EditorConfig Editor
+editorConfigDocumentSetupParticipant=EditorConfig Document Setup Participant
+
+editorConfigPresentation.label=Editor Config
+editorConfigEditorPresentationActionSet.label= EditorConfig Editor Presentation
+editorConfigEditorFontDefinition.label= EditorConfig Editor Text Font
+editorConfigEditorFontDefinition.description= The EditorConfig editor text font is used by .editorconfig editors.
+
+# Preferences
+editorConfig.preferences.main=Editor Config
+editorConfig.preferences.editor=Editor
+editorConfig.preferences.syntaxcoloring=Syntax Coloring
@@ -6,18 +6,75 @@
point="org.eclipse.ui.editors">
<editor
id="org.eclipse.editorconfig.ui.EditorConfigEditor"
- name="EditorConfig Editor"
- class="org.eclipse.ui.editors.text.TextEditor"
+ name="%EditorConfigEditor.name"
+ class="org.eclipse.editorconfig.ui.internal.editor.EditorConfigEditor"
default="true"
- extensions="editorconfig"
- icon="icons/favicon_top_right_corner_file.png">
+ icon="icons/favicon_top_right_corner_file.png"
+ symbolicFontName="org.eclipse.editorconfig.ui.editors.textfont">
+ <contentTypeBinding contentTypeId="org.eclipse.editorconfig.core.editorconfigsource" />
</editor>
</extension>
-
+ <extension
+ id="EditorConfigDocumentSetupParticipant"
+ name="%editorConfigDocumentSetupParticipant"
+ point="org.eclipse.core.filebuffers.documentSetup">
+ <participant
+ contentTypeId="org.eclipse.editorconfig.core.editorconfigsource"
+ class="org.eclipse.editorconfig.ui.internal.text.EditorConfigDocumentSetupParticipant">
+ </participant>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.themes">
+ <themeElementCategory label="%editorConfigPresentation.label" id="org.eclipse.editorconfig.ui.presentation"/>
+ <fontDefinition
+ label="%editorConfigEditorFontDefinition.label"
+ defaultsTo="org.eclipse.jface.textfont"
+ categoryId="org.eclipse.editorconfig.ui.presentation"
+ id="org.eclipse.editorconfig.ui.editors.textfont">
+ <description>
+ %editorConfigEditorFontDefinition.description
+ </description>
+ </fontDefinition>
+ </extension>
+
+ <!-- dark theme defaults -->
+ <extension
+ point="org.eclipse.e4.ui.css.swt.theme">
+ <stylesheet uri="css/dark/preferencestyle.css">
+ <themeid refid="org.eclipse.e4.ui.css.theme.e4_dark"></themeid>
+ </stylesheet>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.eclipse.editorconfig.ui.internal.preferences.EditorConfigUIPreferenceInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ name="%editorConfig.preferences.main"
+ class="org.eclipse.editorconfig.ui.internal.preferences.MainPreferencePage"
+ id="org.eclipse.editorconfig.ui.preferences.MainPreferencePage">
+ </page>
+ <page
+ name="%editorConfig.preferences.editor"
+ category="org.eclipse.editorconfig.ui.preferences.MainPreferencePage"
+ class="org.eclipse.editorconfig.ui.internal.preferences.EditorPreferencePage"
+ id="org.eclipse.editorconfig.ui.preferences.EditorPreferencePage">
+ </page>
+ <page
+ name="%editorConfig.preferences.syntaxcoloring"
+ category="org.eclipse.editorconfig.ui.preferences.EditorPreferencePage"
+ class="org.eclipse.editorconfig.ui.internal.preferences.SyntaxColoringPreferencePage"
+ id="org.eclipse.editorconfig.ui.preferences.SyntaxColoringPreferencePage">
+ </page>
+ </extension>
+
<extension point="org.eclipse.ui.propertyPages">
<page
- class="org.eclipse.editorconfig.internal.ui.EditorConfigPropertyPage"
+ class="org.eclipse.editorconfig.ui.internal.preferences.EditorConfigPropertyPage"
id="org.eclipse.editorconfig.ui.editorConfigPropertyPage"
name="Editor Config"
nameFilter="*.*">
@@ -28,7 +85,7 @@
</extension>
<extension point="org.eclipse.ui.startup">
- <startup class="org.eclipse.editorconfig.internal.ui.EditorConfigEclipseStartup"/>
+ <startup class="org.eclipse.editorconfig.ui.internal.EditorConfigEclipseStartup"/>
</extension>
</plugin>
@@ -1,53 +0,0 @@
-package org.eclipse.editorconfig.internal.ui;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class EditorConfigUIPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.editorconfig.ui"; //$NON-NLS-1$
-
- // The shared instance
- private static EditorConfigUIPlugin plugin;
-
- /**
- * The constructor
- */
- public EditorConfigUIPlugin() {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
- * BundleContext )
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
- * BundleContext )
- */
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static EditorConfigUIPlugin getDefault() {
- return plugin;
- }
-}
Oops, something went wrong.

0 comments on commit d258f6c

Please sign in to comment.