--- a/apisupport.project/manifest.mf +++ a/apisupport.project/manifest.mf @@ -6,5 +6,5 @@ org.netbeans.api.javahelp.Help OpenIDE-Module-Layer: org/netbeans/modules/apisupport/project/ui/resources/layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.33 +OpenIDE-Module-Specification-Version: 1.34 --- a/apisupport.project/nbproject/project.xml +++ a/apisupport.project/nbproject/project.xml @@ -145,8 +145,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/beans/nbproject/project.properties +++ a/beans/nbproject/project.properties @@ -38,4 +38,4 @@ # made subject to such option by the copyright holder. javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.25.0 +spec.version.base=1.26.0 --- a/beans/nbproject/project.xml +++ a/beans/nbproject/project.xml @@ -122,8 +122,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/bpel.debugger.ui/manifest.mf +++ a/bpel.debugger.ui/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.3 +OpenIDE-Module-Specification-Version: 1.4 OpenIDE-Module: org.netbeans.modules.bpel.debugger.ui OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bpel/debugger/ui/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/bpel/debugger/ui/resources/layer.xml --- a/bpel.debugger.ui/nbproject/project.xml +++ a/bpel.debugger.ui/nbproject/project.xml @@ -99,8 +99,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/bugtracking.bridge/manifest.mf +++ a/bugtracking.bridge/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.bugtracking.bridge OpenIDE-Module-Layer: org/netbeans/modules/bugtracking/bridge/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugtracking/bridge/Bundle.properties -OpenIDE-Module-Specification-Version: 1.4 +OpenIDE-Module-Specification-Version: 1.5 --- a/bugtracking.bridge/nbproject/project.xml +++ a/bugtracking.bridge/nbproject/project.xml @@ -36,8 +36,8 @@ - 1 - 1.30 + 2 + 2.1 --- a/cnd.asm/nbproject/project.properties +++ a/cnd.asm/nbproject/project.properties @@ -3,4 +3,4 @@ nbm.module.author=Egor Ushakov (gorrus@netbeans.org), Alexey Mishenin (alms@netbeans.org) nbm.needs.restart=true -spec.version.base=1.7.0 +spec.version.base=1.8.0 --- a/cnd.asm/nbproject/project.xml +++ a/cnd.asm/nbproject/project.xml @@ -62,8 +62,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.classview/nbproject/project.properties +++ a/cnd.classview/nbproject/project.properties @@ -1,3 +1,3 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.classview/nbproject/project.xml +++ a/cnd.classview/nbproject/project.xml @@ -63,8 +63,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.completion/nbproject/project.properties +++ a/cnd.completion/nbproject/project.properties @@ -1,4 +1,4 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.completion/nbproject/project.xml +++ a/cnd.completion/nbproject/project.xml @@ -114,8 +114,8 @@ - 1 - 1.33 + 2 + 2.1 --- a/cnd.editor/nbproject/project.properties +++ a/cnd.editor/nbproject/project.properties @@ -1,3 +1,3 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.editor/nbproject/project.xml +++ a/cnd.editor/nbproject/project.xml @@ -71,8 +71,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.gizmo/manifest.mf +++ a/cnd.gizmo/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module-Layer: org/netbeans/modules/cnd/gizmo/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cnd/gizmo/resources/Bundle.properties OpenIDE-Module-Provides: org.netbeans.modules.dlight.spi.SourceFileInfoProvider -OpenIDE-Module-Specification-Version: 1.4 +OpenIDE-Module-Specification-Version: 1.5 --- a/cnd.gizmo/nbproject/project.xml +++ a/cnd.gizmo/nbproject/project.xml @@ -128,8 +128,8 @@ - 1 - 1.38 + 2 + 2.1 --- a/cnd.gotodeclaration/manifest.mf +++ a/cnd.gotodeclaration/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.cnd.gotodeclaration OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cnd/gotodeclaration/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 AutoUpdate-Show-In-Client: false --- a/cnd.gotodeclaration/nbproject/project.xml +++ a/cnd.gotodeclaration/nbproject/project.xml @@ -81,8 +81,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.highlight/nbproject/project.properties +++ a/cnd.highlight/nbproject/project.properties @@ -1,3 +1,3 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.10.0 +spec.version.base=1.11.0 --- a/cnd.highlight/nbproject/project.xml +++ a/cnd.highlight/nbproject/project.xml @@ -115,8 +115,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.model.services/nbproject/project.properties +++ a/cnd.model.services/nbproject/project.properties @@ -3,4 +3,4 @@ javac.source=1.5 sigtest.mail=cvs@cnd.netbeans.org -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.model.services/nbproject/project.xml +++ a/cnd.model.services/nbproject/project.xml @@ -54,8 +54,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.modelimpl/nbproject/project.properties +++ a/cnd.modelimpl/nbproject/project.properties @@ -4,4 +4,4 @@ sigtest.mail=cvs@cnd.netbeans.org -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.modelimpl/nbproject/project.xml +++ a/cnd.modelimpl/nbproject/project.xml @@ -106,8 +106,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.modelui/manifest.mf +++ a/cnd.modelui/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.cnd.modelui OpenIDE-Module-Layer: org/netbeans/modules/cnd/modelui/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cnd/modelui/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 AutoUpdate-Show-In-Client: false --- a/cnd.modelui/nbproject/project.xml +++ a/cnd.modelui/nbproject/project.xml @@ -133,8 +133,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.modelutil/nbproject/project.properties +++ a/cnd.modelutil/nbproject/project.properties @@ -1,3 +1,3 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/cnd.modelutil/nbproject/project.xml +++ a/cnd.modelutil/nbproject/project.xml @@ -72,8 +72,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.navigation/manifest.mf +++ a/cnd.navigation/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.cnd.navigation OpenIDE-Module-Layer: org/netbeans/modules/cnd/navigation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cnd/navigation/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 AutoUpdate-Show-In-Client: false --- a/cnd.navigation/nbproject/project.xml +++ a/cnd.navigation/nbproject/project.xml @@ -89,8 +89,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.qnavigator/manifest.mf +++ a/cnd.qnavigator/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.cnd.qnavigator/1 OpenIDE-Module-Layer: org/netbeans/modules/cnd/qnavigator/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/cnd/qnavigator/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 AutoUpdate-Show-In-Client: false --- a/cnd.qnavigator/nbproject/project.xml +++ a/cnd.qnavigator/nbproject/project.xml @@ -72,8 +72,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd.refactoring/nbproject/project.properties +++ a/cnd.refactoring/nbproject/project.properties @@ -1,4 +1,4 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 nbm.module.author=Vladimir Voskresensky (vv159170@netbeans.org) -spec.version.base=1.7.0 +spec.version.base=1.8.0 --- a/cnd.refactoring/nbproject/project.xml +++ a/cnd.refactoring/nbproject/project.xml @@ -108,8 +108,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/cnd/nbproject/project.properties +++ a/cnd/nbproject/project.properties @@ -3,6 +3,6 @@ javahelp.hs=cnd.hs sigtest.mail=cvs@cnd.netbeans.org -spec.version.base=1.9.0 +spec.version.base=1.10.0 nbm.executable.files=bin/dorun.sh --- a/cnd/nbproject/project.xml +++ a/cnd/nbproject/project.xml @@ -122,8 +122,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/collab.channel.chat/manifest.mf +++ a/collab.channel.chat/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.collab.channel.chat/1 -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/collab/channel/chat/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/collab/channel/chat/resources/layer.xml AutoUpdate-Show-In-Client: false --- a/collab.channel.chat/nbproject/project.xml +++ a/collab.channel.chat/nbproject/project.xml @@ -70,8 +70,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/compapp.casaeditor/manifest.mf +++ a/compapp.casaeditor/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.compapp.casaeditor OpenIDE-Module-Layer: org/netbeans/modules/compapp/casaeditor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/compapp/casaeditor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.2 +OpenIDE-Module-Specification-Version: 1.3 AutoUpdate-Show-In-Client: false --- a/compapp.casaeditor/nbproject/project.xml +++ a/compapp.casaeditor/nbproject/project.xml @@ -111,8 +111,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/compapp.projects.base/manifest.mf +++ a/compapp.projects.base/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 1.3 +OpenIDE-Module-Specification-Version: 1.4 OpenIDE-Module: org.netbeans.modules.compapp.projects.base OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/compapp/projects/base/Bundle.properties AutoUpdate-Show-In-Client: false --- a/compapp.projects.base/nbproject/project.xml +++ a/compapp.projects.base/nbproject/project.xml @@ -64,8 +64,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/compapp.projects.jbi/manifest.mf +++ a/compapp.projects.jbi/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.compapp.projects.jbi OpenIDE-Module-Layer: org/netbeans/modules/compapp/projects/jbi/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/compapp/projects/jbi/Bundle.properties -OpenIDE-Module-Specification-Version: 1.2.1 +OpenIDE-Module-Specification-Version: 1.3 AutoUpdate-Show-In-Client: false --- a/compapp.projects.jbi/nbproject/project.xml +++ a/compapp.projects.jbi/nbproject/project.xml @@ -156,8 +156,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/csl.api/nbproject/project.properties +++ a/csl.api/nbproject/project.properties @@ -37,7 +37,7 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -spec.version.base=1.16.0 +spec.version.base=1.17.0 is.autoload=true javac.source=1.5 --- a/csl.api/nbproject/project.xml +++ a/csl.api/nbproject/project.xml @@ -118,8 +118,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/css.editor/manifest.mf +++ a/css.editor/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.css.editor/1 OpenIDE-Module-Layer: org/netbeans/modules/css/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/css/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.8 +OpenIDE-Module-Specification-Version: 1.9 AutoUpdate-Show-In-Client: false --- a/css.editor/nbproject/project.xml +++ a/css.editor/nbproject/project.xml @@ -46,8 +46,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/css.visual/manifest.mf +++ a/css.visual/manifest.mf @@ -5,4 +5,4 @@ OpenIDE-Module-Install: org/netbeans/modules/css/CssModuleInstall.class OpenIDE-Module-Requires: org.openide.windows.IOProvider AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 2.9 +OpenIDE-Module-Specification-Version: 2.10 --- a/css.visual/nbproject/project.xml +++ a/css.visual/nbproject/project.xml @@ -105,8 +105,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/db.core/manifest.mf +++ a/db.core/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.db.core -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/core/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/db/core/resources/layer.xml OpenIDE-Module-Requires: org.openide.windows.IOProvider --- a/db.core/nbproject/project.xml +++ a/db.core/nbproject/project.xml @@ -86,8 +86,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/db.sql.editor/nbproject/project.properties +++ a/db.sql.editor/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.13.0 +spec.version.base=1.14.0 # org-netbeans-core: for /xml/lookups in the default fs # (needed in order to load database connections from the SFS) --- a/db.sql.editor/nbproject/project.xml +++ a/db.sql.editor/nbproject/project.xml @@ -112,8 +112,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/debugger.jpda.ant/manifest.mf +++ a/debugger.jpda.ant/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.debugger.jpda.ant -OpenIDE-Module-Specification-Version: 1.15 +OpenIDE-Module-Specification-Version: 1.16 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ant/Bundle.properties --- a/debugger.jpda.ant/nbproject/project.xml +++ a/debugger.jpda.ant/nbproject/project.xml @@ -98,8 +98,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/debugger.jpda.projects/manifest.mf +++ a/debugger.jpda.projects/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/projects/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/projects/resources/mf-layer.xml OpenIDE-Module-Provides: org.netbeans.spi.debugger.jpda.EditorContext, org.netbeans.spi.debugger.jpda.SourcePathProvider -OpenIDE-Module-Specification-Version: 1.10 +OpenIDE-Module-Specification-Version: 1.11 --- a/debugger.jpda.projects/nbproject/project.xml +++ a/debugger.jpda.projects/nbproject/project.xml @@ -93,8 +93,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/debugger.jpda.ui/manifest.mf +++ a/debugger.jpda.ui/manifest.mf @@ -2,7 +2,7 @@ OpenIDE-Module: org.netbeans.modules.debugger.jpda.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, org.netbeans.spi.debugger.ui OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.ui --- a/debugger.jpda.ui/nbproject/project.xml +++ a/debugger.jpda.ui/nbproject/project.xml @@ -91,8 +91,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/WatchPanel.java +++ a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/WatchPanel.java @@ -42,7 +42,6 @@ import java.awt.AWTKeyStroke; import java.awt.Dimension; -import java.awt.FontMetrics; import java.awt.KeyboardFocusManager; import java.awt.event.ActionEvent; import java.lang.reflect.InvocationTargetException; @@ -71,13 +70,11 @@ import java.awt.EventQueue; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; -import java.awt.Insets; import java.awt.event.ActionListener; import java.io.IOException; import javax.swing.text.StyledDocument; import org.netbeans.api.debugger.Session; import org.netbeans.editor.EditorUI; -import org.netbeans.editor.ext.ExtCaret; import org.netbeans.spi.debugger.jpda.EditorContext; import org.netbeans.spi.debugger.ui.EditorContextDispatcher; import org.openide.ErrorManager; @@ -254,7 +251,10 @@ if (eui == null) { return ; } - eui.removeLayer(ExtCaret.HIGHLIGHT_ROW_LAYER_NAME); + editorPane.putClientProperty( + "HighlightsLayerExcludes", //NOI18N + "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.CaretRowHighlighting$" //NOI18N + ); // Do not draw text limit line try { java.lang.reflect.Field textLimitLineField = EditorUI.class.getDeclaredField("textLimitLineVisible"); // NOI18N --- a/debugger.jpda/manifest.mf +++ a/debugger.jpda/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.debugger.jpda/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.27 +OpenIDE-Module-Specification-Version: 1.28 OpenIDE-Module-Provides: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl OpenIDE-Module-Requires: org.netbeans.spi.debugger.jpda.EditorContext, org.netbeans.spi.debugger.jpda.SourcePathProvider --- a/debugger.jpda/nbproject/project.xml +++ a/debugger.jpda/nbproject/project.xml @@ -93,8 +93,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/diff/nbproject/project.properties +++ a/diff/nbproject/project.properties @@ -40,7 +40,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.25.0 +spec.version.base=1.26.0 javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml --- a/diff/nbproject/project.xml +++ a/diff/nbproject/project.xml @@ -84,8 +84,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/dlight.annotationsupport/nbproject/project.properties +++ a/dlight.annotationsupport/nbproject/project.properties @@ -1,4 +1,4 @@ javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.4.0 +spec.version.base=1.5.0 #spec.version.base.fatal.warning=false --- a/dlight.annotationsupport/nbproject/project.xml +++ a/dlight.annotationsupport/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.41 + 2 + 2.1 --- a/editor.actions/nbproject/project.properties +++ a/editor.actions/nbproject/project.properties @@ -40,7 +40,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 javadoc.title=Editor Actions -spec.version.base=1.3.0 +spec.version.base=1.4.0 #javadoc.arch=${basedir}/arch.xml #javadoc.apichanges=${basedir}/apichanges.xml --- a/editor.actions/nbproject/project.xml +++ a/editor.actions/nbproject/project.xml @@ -51,8 +51,8 @@ - 1 - 1.40 + 2 + 2.1 --- a/editor.bookmarks/manifest.mf +++ a/editor.bookmarks/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.bookmarks/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/bookmarks/Bundle.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 OpenIDE-Module-Layer: org/netbeans/modules/editor/bookmarks/resources/layer.xml OpenIDE-Module-Install: org/netbeans/modules/editor/bookmarks/EditorBookmarksModule.class AutoUpdate-Show-In-Client: false --- a/editor.bookmarks/nbproject/project.xml +++ a/editor.bookmarks/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.bracesmatching/manifest.mf +++ a/editor.bracesmatching/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.editor.bracesmatching/0 OpenIDE-Module-Layer: org/netbeans/modules/editor/bracesmatching/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/bracesmatching/Bundle.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 AutoUpdate-Show-In-Client: false --- a/editor.bracesmatching/nbproject/project.xml +++ a/editor.bracesmatching/nbproject/project.xml @@ -28,8 +28,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.codetemplates/nbproject/project.properties +++ a/editor.codetemplates/nbproject/project.properties @@ -42,4 +42,4 @@ #javadoc.name=EditorCodeTemplates javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=1.15.0 +spec.version.base=1.16.0 --- a/editor.codetemplates/nbproject/project.xml +++ a/editor.codetemplates/nbproject/project.xml @@ -77,8 +77,8 @@ - 1 - 1.31 + 2 + 2.1 --- a/editor.completion/nbproject/project.properties +++ a/editor.completion/nbproject/project.properties @@ -41,4 +41,4 @@ javac.source=1.5 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=1.18.0 +spec.version.base=1.19.0 --- a/editor.completion/nbproject/project.xml +++ a/editor.completion/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.deprecated.pre61completion/manifest.mf +++ a/editor.deprecated.pre61completion/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.deprecated.pre61completion/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/deprecated/pre61completion/Bundle.properties -OpenIDE-Module-Specification-Version: 1.1 +OpenIDE-Module-Specification-Version: 1.2 OpenIDE-Module-Deprecated: true --- a/editor.deprecated.pre61completion/nbproject/project.xml +++ a/editor.deprecated.pre61completion/nbproject/project.xml @@ -19,8 +19,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.deprecated.pre61settings/nbproject/project.properties +++ a/editor.deprecated.pre61settings/nbproject/project.properties @@ -1,4 +1,4 @@ is.autoload=true javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.6.0 +spec.version.base=1.7.0 --- a/editor.deprecated.pre61settings/nbproject/project.xml +++ a/editor.deprecated.pre61settings/nbproject/project.xml @@ -60,7 +60,7 @@ - 1 + 2 --- a/editor.errorstripe/nbproject/project.properties +++ a/editor.errorstripe/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=2.10.0 +spec.version.base=2.11.0 nbm.needs.restart=true --- a/editor.errorstripe/nbproject/project.xml +++ a/editor.errorstripe/nbproject/project.xml @@ -68,8 +68,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.indent/nbproject/project.properties +++ a/editor.indent/nbproject/project.properties @@ -39,7 +39,7 @@ javac.source=1.5 javac.compilerargs=-Xlint:unchecked -spec.version.base=1.16.0 +spec.version.base=1.17.0 javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml --- a/editor.indent/nbproject/project.xml +++ a/editor.indent/nbproject/project.xml @@ -51,7 +51,7 @@ - 1 + 2 --- a/editor.lib/apichanges.xml +++ a/editor.lib/apichanges.xml @@ -104,6 +104,21 @@ + + Removing DrawLayer and related API + + + + + +

+ Removing DrawLayer and related classes and methods. This part of the API has been long time deprecated + and replaced by Highlighting SPI on editor.lib2 module. +

+
+ +
+ Adding interface enabling initialization of lookups performed by SideBarFactory implementations. --- a/editor.lib/manifest.mf +++ a/editor.lib/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 -OpenIDE-Module: org.netbeans.modules.editor.lib/1 +OpenIDE-Module: org.netbeans.modules.editor.lib/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib/Bundle.properties -OpenIDE-Module-Implementation-Version: 9 +OpenIDE-Module-Implementation-Version: 10 --- a/editor.lib/nbproject/project.properties +++ a/editor.lib/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.45.0 +spec.version.base=2.1 is.autoload=true javadoc.arch=${basedir}/arch.xml --- a/editor.lib/src/org/netbeans/editor/ActionFactory.java +++ a/editor.lib/src/org/netbeans/editor/ActionFactory.java @@ -85,6 +85,7 @@ import org.netbeans.api.progress.ProgressUtils; import org.netbeans.modules.editor.lib2.search.EditorFindSupport; import org.netbeans.lib.editor.util.swing.DocumentUtilities; +import org.netbeans.lib.editor.view.GapBoxView; import org.openide.util.NbBundle; import org.openide.util.WeakListeners; import org.openide.util.actions.Presenter; @@ -2281,7 +2282,7 @@ } public void actionPerformed(ActionEvent evt, JTextComponent target) { - DrawEngineDocView rootView = (DrawEngineDocView)Utilities.getDocumentView(target); + GapBoxView rootView = (GapBoxView)Utilities.getDocumentView(target); AbstractDocument adoc = (AbstractDocument)target.getDocument(); // Dump fold hierarchy --- a/editor.lib/src/org/netbeans/editor/Annotations.java +++ a/editor.lib/src/org/netbeans/editor/Annotations.java @@ -64,6 +64,8 @@ import javax.swing.JMenuItem; import javax.swing.SwingUtilities; import org.netbeans.editor.ext.ExtKit; +import org.netbeans.modules.editor.lib.drawing.ChainDrawMark; +import org.netbeans.modules.editor.lib.drawing.MarkChain; import org.openide.awt.Actions; import org.openide.awt.DynamicMenuContent; import org.openide.util.ContextAwareAction; @@ -178,15 +180,6 @@ } - /** Finds the drawing layer for annotations. - * @return null - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public DrawLayerFactory.AnnotationLayer getLayer() { - return null; - } - /** Add annotation */ public void addAnnotation(AnnotationDesc anno) { @@ -241,7 +234,7 @@ + ", docLen=" + doc.getLength()); // NOI18N } // attach created mark to annotation - MarkFactory.ChainDrawMark annoMark = chain.getAddedMark(); + ChainDrawMark annoMark = chain.getAddedMark(); if (annoMark == null) { throw new NullPointerException(); } @@ -320,7 +313,7 @@ int line; synchronized (lineAnnotationsArray) { // find LineAnnotations for the mark - MarkFactory.ChainDrawMark annoMark = (MarkFactory.ChainDrawMark)anno.getMark(); + ChainDrawMark annoMark = (ChainDrawMark)anno.getMark(); if (annoMark == null) { // Already removed? See #116955 return; --- a/editor.lib/src/org/netbeans/editor/BaseDocument.java +++ a/editor.lib/src/org/netbeans/editor/BaseDocument.java @@ -97,6 +97,10 @@ import org.netbeans.modules.editor.lib.FormatterOverride; import org.netbeans.modules.editor.lib.TrailingWhitespaceRemove; import org.netbeans.modules.editor.lib.SettingsConversions; +import org.netbeans.modules.editor.lib.drawing.DrawEngine; +import org.netbeans.modules.editor.lib.drawing.DrawGraphics; +import org.netbeans.modules.editor.lib.impl.MarkVector; +import org.netbeans.modules.editor.lib.impl.MultiMark; import org.openide.util.Lookup; import org.openide.util.RequestProcessor; import org.openide.util.RequestProcessor.Task; @@ -257,9 +261,6 @@ private SyntaxSupport syntaxSupport; - /** Layer list for document level layers */ - private DrawLayerList drawLayerList = new DrawLayerList(); - /** Reset merging next created undoable edit to the last one. */ boolean undoMergeReset; @@ -2014,38 +2015,6 @@ return modified; } - /** - * Get the layer with the specified name. Using of DrawLayers - * has been deprecated. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public DrawLayer findLayer(String layerName) { - return drawLayerList.findLayer(layerName); - } - - /** - * Using of DrawLayers has been deprecated. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public boolean addLayer(DrawLayer layer, int visibility) { - if (drawLayerList.add(layer, visibility)) { - BaseDocumentEvent evt = getDocumentEvent(0, 0, DocumentEvent.EventType.CHANGE, null); - evt.addEdit(new BaseDocumentEvent.DrawLayerChange(layer.getName(), visibility)); - fireChangedUpdate(evt); - return true; - } else { - return false; - } - } - - final DrawLayerList getDrawLayerList() { - return drawLayerList; - } - private LineRootElement getLineRootElement() { return lineRootElement; } @@ -2445,10 +2414,24 @@ private static final class Accessor extends EditorPackageAccessor { @Override - public CompoundEdit markAtomicEditsNonSignificant(BaseDocument doc) { + public CompoundEdit BaseDocument_markAtomicEditsNonSignificant(BaseDocument doc) { return doc.markAtomicEditsNonSignificant(); } + @Override + public MarkVector BaseDocument_getMarksStorage(BaseDocument doc) { + return doc.marksStorage; + } + + @Override + public Mark BaseDocument_getMark(BaseDocument doc, MultiMark multiMark) { + return doc.marks.get(multiMark); + } + + @Override + public void Mark_insert(Mark mark, BaseDocument doc, int pos) throws InvalidMarkException, BadLocationException { + mark.insert(doc, pos); + } } // XXX: the same as the one in CloneableEditorSupport --- a/editor.lib/src/org/netbeans/editor/BaseDocumentEvent.java +++ a/editor.lib/src/org/netbeans/editor/BaseDocumentEvent.java @@ -50,7 +50,6 @@ import javax.swing.event.DocumentEvent; import javax.swing.text.AttributeSet; import javax.swing.undo.UndoableEdit; -import javax.swing.undo.AbstractUndoableEdit; import javax.swing.undo.CannotUndoException; import javax.swing.undo.CannotRedoException; @@ -238,26 +237,6 @@ return getFixLineSyntaxState().getSyntaxUpdateTokenList(); } - public String getDrawLayerName() { - if (getType() != DocumentEvent.EventType.CHANGE) { - throw new IllegalStateException("Can be called for CHANGE events only."); // NOI18N - } - - DrawLayerChange dlc = (DrawLayerChange)findEdit(DrawLayerChange.class); - - return (dlc != null) ? dlc.getDrawLayerName() : null; - } - - public int getDrawLayerVisibility() { - if (getType() != DocumentEvent.EventType.CHANGE) { - throw new IllegalStateException("Can be called for CHANGE events only."); // NOI18N - } - - DrawLayerChange dlc = (DrawLayerChange)findEdit(DrawLayerChange.class); - - return (dlc != null) ? dlc.getDrawLayerVisibility() : -1; - } - /** Whether this event is being fired because it's being undone. */ public boolean isInUndo() { return inUndo; @@ -268,7 +247,7 @@ return inRedo; } - public void undo() throws CannotUndoException { + public @Override void undo() throws CannotUndoException { BaseDocument doc = (BaseDocument)getDocument(); doc.incrementDocVersion(); @@ -328,7 +307,7 @@ inUndo = false; } - public void redo() throws CannotRedoException { + public @Override void redo() throws CannotRedoException { BaseDocument doc = (BaseDocument)getDocument(); doc.incrementDocVersion(); @@ -386,7 +365,7 @@ inRedo = false; } - public boolean addEdit(UndoableEdit anEdit) { + public @Override boolean addEdit(UndoableEdit anEdit) { // Super of addEdit() // if the number of changes gets too great, start using @@ -458,7 +437,7 @@ } } - public boolean canUndo() { + public @Override boolean canUndo() { // Super of canUndo return !inProgress2 && alive2 && hasBeenDone2 // End super of canUndo @@ -470,24 +449,24 @@ * * @see #isInProgress */ - public boolean canRedo() { + public @Override boolean canRedo() { // Super of canRedo return !inProgress2 && alive2 && !hasBeenDone2; // End super of canRedo } - public boolean isInProgress() { + public @Override boolean isInProgress() { // Super of isInProgress() return inProgress2; // End super of isInProgress() } - public String getUndoPresentationName() { - return ""; + public @Override String getUndoPresentationName() { + return ""; //NOI18N } - public String getRedoPresentationName() { - return ""; + public @Override String getRedoPresentationName() { + return ""; //NOI18N } /** Returns true if this event can be merged by the previous @@ -532,7 +511,7 @@ * parts (words) and undoing/redoing them at once. * This method returns true whether */ - public boolean replaceEdit(UndoableEdit anEdit) { + public @Override boolean replaceEdit(UndoableEdit anEdit) { BaseDocument doc = (BaseDocument)getDocument(); if (anEdit instanceof BaseDocument.AtomicCompoundEdit) { BaseDocument.AtomicCompoundEdit compEdit @@ -557,7 +536,7 @@ return false; } - public void die() { + public @Override void die() { // Super of die() int size = edits.size(); for (int i = size-1; i >= 0; i--) @@ -575,13 +554,13 @@ } } - public void end() { + public @Override void end() { // Super of end() inProgress2 = false; // End super of end() } - public DocumentEvent.ElementChange getChange(Element elem) { + public @Override DocumentEvent.ElementChange getChange(Element elem) { // Super of getChange() if (changeLookup2 != null) { return (DocumentEvent.ElementChange) changeLookup2.get(elem); @@ -601,33 +580,11 @@ } - public String toString() { + public @Override String toString() { return System.identityHashCode(this) + " " + super.toString() // NOI18N + ", type=" + getType() // NOI18N + ((getType() != DocumentEvent.EventType.CHANGE) ? ("text='" + getText() + "'") : ""); // NOI18N } - /** Edit describing the change of the document draw-layers */ - static class DrawLayerChange extends AbstractUndoableEdit { - - String drawLayerName; - - int drawLayerVisibility; - - DrawLayerChange(String drawLayerName, int drawLayerVisibility) { - this.drawLayerName = drawLayerName; - this.drawLayerVisibility = drawLayerVisibility; - } - - public String getDrawLayerName() { - return drawLayerName; - } - - public int getDrawLayerVisibility() { - return drawLayerVisibility; - } - - } - } --- a/editor.lib/src/org/netbeans/editor/BaseTextUI.java +++ a/editor.lib/src/org/netbeans/editor/BaseTextUI.java @@ -43,7 +43,6 @@ import java.awt.*; import java.awt.event.ActionEvent; -import java.beans.Customizer; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; import java.util.ArrayList; @@ -67,9 +66,12 @@ import org.netbeans.api.editor.settings.SimpleValueNames; import org.netbeans.modules.editor.lib2.EditorApiPackageAccessor; import org.netbeans.editor.view.spi.LockView; +import org.netbeans.lib.editor.view.GapDocumentView; import org.netbeans.modules.editor.lib2.EditorPreferencesDefaults; import org.netbeans.modules.editor.lib2.EditorPreferencesKeys; import org.netbeans.modules.editor.lib.SettingsConversions; +import org.netbeans.modules.editor.lib.drawing.DrawEngineDocView; +import org.netbeans.modules.editor.lib.drawing.DrawEngineLineView; import org.openide.util.WeakListeners; /** @@ -341,7 +343,7 @@ LockView lockView = (LockView) view; lockView.lock(); try { - DrawEngineDocView docView = (DrawEngineDocView)view.getView(0); + GapDocumentView docView = (GapDocumentView)view.getView(0); doDamageRange = docView.checkDamageRange(p0, p1, p0Bias, p1Bias); } finally { lockView.unlock(); @@ -472,21 +474,13 @@ */ public void changedUpdate(DocumentEvent evt) { if (evt instanceof BaseDocumentEvent) { - BaseDocumentEvent bdevt = (BaseDocumentEvent)evt; - BaseDocument doc = (BaseDocument)bdevt.getDocument(); - String layerName = bdevt.getDrawLayerName(); - if (layerName != null) { - getEditorUI().addLayer(doc.findLayer(layerName), - bdevt.getDrawLayerVisibility()); - }else{ //temp - try { - JTextComponent comp = getComponent(); - if (comp!=null && comp.isShowing()) { - getEditorUI().repaintBlock(evt.getOffset(), evt.getOffset() + evt.getLength()); - } - } catch (BadLocationException ex) { - Utilities.annotateLoggable(ex); + try { + JTextComponent comp = getComponent(); + if (comp!=null && comp.isShowing()) { + getEditorUI().repaintBlock(evt.getOffset(), evt.getOffset() + evt.getLength()); } + } catch (BadLocationException ex) { + Utilities.annotateLoggable(ex); } } } --- a/editor.lib/src/org/netbeans/editor/BaseView.java +++ a/editor.lib/src/org/netbeans/editor/BaseView.java @@ -49,6 +49,7 @@ import javax.swing.text.Element; import javax.swing.text.JTextComponent; import javax.swing.text.BadLocationException; +import org.netbeans.modules.editor.lib.drawing.DrawGraphics; /** * Base abstract view serves as parent for both @@ -105,12 +106,11 @@ } /** Get aligment along an X_AXIS or Y_AXIS */ - public float getAlignment(int axis) { + public @Override float getAlignment(int axis) { return 0f; } - abstract void modelToViewDG(int pos, DrawGraphics dg) - throws BadLocationException; + /* package */ abstract void modelToViewDG(int pos, DrawGraphics dg) throws BadLocationException; /** Get y-coord value from position */ protected abstract int getYFromPos(int pos) throws BadLocationException; @@ -267,7 +267,7 @@ } - public String toString() { + public @Override String toString() { return "BaseView=" + System.identityHashCode(this) // NOI18N + ", elem=" + getElement() + ", parent=" // NOI18N + System.identityHashCode(getParent()); --- a/editor.lib/src/org/netbeans/editor/Coloring.java +++ a/editor.lib/src/org/netbeans/editor/Coloring.java @@ -49,6 +49,8 @@ import javax.swing.text.AttributeSet; import javax.swing.text.StyleConstants; import org.netbeans.api.editor.settings.EditorStyleConstants; +import org.netbeans.modules.editor.lib.drawing.ColoringAccessor; +import org.netbeans.modules.editor.lib.drawing.DrawContext; /** * Immutable class that stores font and foreground and background colors. @@ -137,7 +139,9 @@ private Color rightBorderLineColor; private Color bottomBorderLineColor; private Color leftBorderLineColor; - + + private final String cacheLock = new String("Coloring.cacheLock"); //NOI18N + /** Cache holding the [original-font, derived-font] pairs * and also original [fore-color, derived-fore-color] pairs. * This helps to avoid the repetitive computations of the @@ -334,7 +338,7 @@ } /** Apply this coloring to draw context. */ - public void apply(DrawContext ctx) { + private void apply(DrawContext ctx) { // Possibly change font if (font != null) { if (fontMode == FONT_MODE_DEFAULT) { @@ -343,7 +347,7 @@ } else { // non-default font-mode Font origFont = ctx.getFont(); if (origFont != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Font f = (Font)fontAndForeColorCache.get(origFont); if (f == null) { f = modifyFont(origFont); @@ -363,7 +367,7 @@ } else { // has alpha Color origForeColor = ctx.getForeColor(); if (origForeColor != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Color fc = (Color)fontAndForeColorCache.get(origForeColor); if (fc == null) { fc = modifyForeColor(origForeColor); @@ -383,7 +387,7 @@ } else { // non-default back color-mode Color origBackColor = ctx.getBackColor(); if (origBackColor != null) { - synchronized (backColorCache) { + synchronized (cacheLock) { Color bc = (Color)backColorCache.get(origBackColor); if (bc == null) { bc = modifyBackColor(origBackColor); @@ -436,7 +440,7 @@ } else { // non-default font-mode Font origFont = c.getFont(); if (origFont != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Font f = (Font)fontAndForeColorCache.get(origFont); if (f == null) { f = modifyFont(origFont); @@ -456,7 +460,7 @@ } else { // non-default fore color-mode Color origForeColor = c.getForeground(); if (origForeColor != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Color fc = (Color)fontAndForeColorCache.get(origForeColor); if (fc == null) { fc = modifyForeColor(origForeColor); @@ -476,7 +480,7 @@ } else { // non-default back color-mode Color origBackColor = c.getBackground(); if (origBackColor != null) { - synchronized (backColorCache) { + synchronized (cacheLock) { Color bc = (Color)backColorCache.get(origBackColor); if (bc == null) { bc = modifyBackColor(origBackColor); @@ -518,7 +522,7 @@ } else { // non-default font-mode if (newFont != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Font f = (Font)fontAndForeColorCache.get(newFont); if (f == null) { f = modifyFont(newFont); @@ -541,7 +545,7 @@ } else { // non-default fore color-mode if (newForeColor != null) { - synchronized (fontAndForeColorCache) { + synchronized (cacheLock) { Color fc = (Color)fontAndForeColorCache.get(newForeColor); if (fc == null) { fc = modifyForeColor(newForeColor); @@ -561,7 +565,7 @@ } else { // non-default back color-mode newBackColor = backColor; if (newBackColor != null) { - synchronized (backColorCache) { + synchronized (cacheLock) { Color bc = (Color)backColorCache.get(newBackColor); if (bc == null) { bc = modifyBackColor(newBackColor); @@ -851,5 +855,15 @@ new Integer(applyMode) }; } - + + static { + ColoringAccessor.register(new Accessor()); + } + + private static final class Accessor extends ColoringAccessor { + @Override + public void apply(Coloring c, DrawContext ctx) { + c.apply(ctx); + } + } // End of Accessor class } --- a/editor.lib/src/org/netbeans/editor/DocumentContent.java +++ a/editor.lib/src/org/netbeans/editor/DocumentContent.java @@ -50,6 +50,9 @@ import javax.swing.undo.CannotRedoException; import javax.swing.undo.UndoableEdit; import org.netbeans.lib.editor.util.AbstractCharSequence; +import org.netbeans.modules.editor.lib.impl.BasePosition; +import org.netbeans.modules.editor.lib.impl.MarkVector; +import org.netbeans.modules.editor.lib.impl.MultiMark; /** * Content of the document. --- a/editor.lib/src/org/netbeans/editor/DrawLayerFactory.java +++ a/editor.lib/src/org/netbeans/editor/DrawLayerFactory.java @@ -1,877 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ - -package org.netbeans.editor; - -import java.awt.Color; -import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.text.Style; -import javax.swing.text.StyleConstants; -import javax.swing.text.BadLocationException; -import javax.swing.text.JTextComponent; -import javax.swing.text.View; -import org.netbeans.api.editor.settings.FontColorNames; - -/** - * Various draw layers are located here - * - * @author Miloslav Metelka - * @version 1.00 - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ -public class DrawLayerFactory { - - private static final Logger LOG = Logger.getLogger(DrawLayerFactory.class.getName()); - - /** Syntax draw layer name */ - public static final String SYNTAX_LAYER_NAME = "syntax-layer"; // NOI18N - - /** Syntax draw layer visibility */ - public static final int SYNTAX_LAYER_VISIBILITY = 1000; - - /** Annotation draw layer name */ - public static final String ANNOTATION_LAYER_NAME = "annotation-layer"; // NOI18N - - /** Annotation draw layer visibility */ - public static final int ANNOTATION_LAYER_VISIBILITY = 2100; - - /** Highlight search layer name */ - public static final String HIGHLIGHT_SEARCH_LAYER_NAME = "highlight-search-layer"; // NOI18N - - /** Highlight search layer visibility */ - public static final int HIGHLIGHT_SEARCH_LAYER_VISIBILITY = 9000; - - /** Incremental search layer name */ - public static final String INC_SEARCH_LAYER_NAME = "inc-search-layer"; // NOI18N - - /** Incremental search layer visibility */ - public static final int INC_SEARCH_LAYER_VISIBILITY = 9500; - - /** Search block layer name */ - public static final String BLOCK_SEARCH_LAYER_NAME = "block-search-layer"; // NOI18N - - /** Search block layer visibility */ - public static final int BLOCK_SEARCH_LAYER_VISIBILITY = 8500; - - /** Selection draw layer name */ - public static final String CARET_LAYER_NAME = "caret-layer"; // NOI18N - - /** Selection draw layer visibility */ - public static final int CARET_LAYER_VISIBILITY = 10000; - - - /** Guarded layer name */ - public static final String GUARDED_LAYER_NAME = "guarded-layer"; // NOI18N - - /** Guarded layer visibility */ - public static final int GUARDED_LAYER_VISIBILITY = 1400; - - - /** - * Layer that colors the text according to the tokens that were parsed. - * It's active all the time. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class SyntaxLayer extends DrawLayer.AbstractLayer { - - public SyntaxLayer() { - super(SYNTAX_LAYER_NAME); - } - - public void init(DrawContext ctx) { - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - return true; - } - - public void updateContext(DrawContext ctx) { - // Get the token type and docColorings - TokenID tokenID = ctx.getTokenID(); - TokenContextPath tcp = ctx.getTokenContextPath(); - if (tokenID != null && tcp != null) { - // Get the coloring according the name of the token - String fullName = tcp.getFullTokenName(tokenID); - Coloring c = ctx.getEditorUI().getColoring(fullName); - if (c != null) { - c.apply(ctx); - - } else { // Token coloring null, try category - TokenCategory cat = tokenID.getCategory(); - if (cat != null) { - fullName = tcp.getFullTokenName(cat); - c = ctx.getEditorUI().getColoring(fullName); - if (c != null) { - c.apply(ctx); - } - } - } - } - } - - } - - - /** - * This layer colors the line by a color specified in constructor - * It requires only activation mark since it deactivates automatically - * at the end of line. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static abstract class ColorLineLayer extends DrawLayer.AbstractLayer { - - /** Coloring to use for highlighting */ - Coloring coloring; - - public ColorLineLayer(String name) { - super(name); - } - - public boolean extendsEOL() { - return true; - } - - public void init(DrawContext ctx) { - coloring = null; - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active; - if (mark == null) { - View view = ctx instanceof DrawEngine.DrawInfo ? ((DrawEngine.DrawInfo)ctx).view.getParent() : null; - if (view instanceof DrawEngineLineView) { - DrawEngineLineView delv = (DrawEngineLineView)view; - mark = getFoldedMark(delv, getName()); - if (mark == null) { - view = delv.getView(delv.getViewCount() -1); - if (view instanceof DrawEngineLineView) { - delv = (DrawEngineLineView) view; - mark = getFoldedMark(delv, getName()); - } - } - } - } - if (mark != null) { - active = (ctx.getEditorUI().getComponent() != null) - && mark.activateLayer; - if (active) { - try { - BaseDocument doc = ctx.getEditorUI().getDocument(); - int nextRowStartPos = Utilities.getRowStart( - doc, ctx.getFragmentOffset(), 1); - if (nextRowStartPos < 0) { // end of doc - nextRowStartPos = Integer.MAX_VALUE; - } - setNextActivityChangeOffset(nextRowStartPos); - - } catch (BadLocationException e) { - active = false; - } - } - } else { - active = false; - } - return active; - } - - public void updateContext(DrawContext ctx) { - if (coloring == null) { - coloring = getColoring(ctx); - } - if (coloring != null) { - coloring.apply(ctx); - } - } - - protected abstract Coloring getColoring(DrawContext ctx); - - } - - - /** Layer that covers selection services provided by caret. - * This layer assumes that both caretMark and selectionMark in - * BaseCaret are properly served so that their active flags - * are properly set. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class CaretLayer extends DrawLayer.AbstractLayer { - - Coloring coloring; - - public CaretLayer() { - super(CARET_LAYER_NAME); - } - - public boolean extendsEmptyLine() { - return true; - } - - public void init(DrawContext ctx) { - coloring = null; - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active; - if (mark != null) { - active = mark.activateLayer; - } else { - JTextComponent c = ctx.getEditorUI().getComponent(); - active = (c != null) && Utilities.isSelectionShowing(c) - && ctx.getFragmentOffset() >= c.getSelectionStart() - && ctx.getFragmentOffset() < c.getSelectionEnd(); - } - - return active; - } - - public void updateContext(DrawContext ctx) { - if (coloring == null) { - coloring = ctx.getEditorUI().getColoring(FontColorNames.SELECTION_COLORING); - } - if (coloring != null) { - coloring.apply(ctx); - } - } - - } - - - /** Highlight search layer highlights all occurences - * of the searched string in text. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class HighlightSearchLayer extends DrawLayer.AbstractLayer { - - /** Pairs of start and end position of the found string */ - int blocks[] = new int[] { -1, -1 }; - - /** Coloring to use for highlighting */ - Coloring coloring; - - /** Current index for painting */ - int curInd; - - /** Enabled flag */ - boolean enabled; - - public HighlightSearchLayer() { - super(HIGHLIGHT_SEARCH_LAYER_NAME); - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public void init(DrawContext ctx) { - if (enabled) { - try { - BaseDocument doc = ctx.getEditorUI().getDocument(); - blocks = FindSupport.getFindSupport().getBlocks(blocks, - doc, ctx.getStartOffset(), ctx.getEndOffset()); - } catch (BadLocationException e) { - blocks = new int[] { -1, -1 }; - } - coloring = null; // reset so it will be re-read - curInd = 0; - } - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active; - if (enabled) { - int pos = ctx.getFragmentOffset(); - if (pos == blocks[curInd]) { - active = true; - setNextActivityChangeOffset(blocks[curInd + 1]); - - } else if (pos == blocks[curInd + 1]) { - active = false; - curInd += 2; - setNextActivityChangeOffset(blocks[curInd]); - if (pos == blocks[curInd]) { // just follows - setNextActivityChangeOffset(blocks[curInd + 1]); - active = true; - } - - } else { - setNextActivityChangeOffset(blocks[curInd]); - active = false; - } - } else { - active = false; - } - - return active; - } - - public void updateContext(DrawContext ctx) { - int pos = ctx.getFragmentOffset(); - if (pos >= blocks[curInd] && pos < blocks[curInd + 1]) { - if (coloring == null) { - coloring = ctx.getEditorUI().getColoring(FontColorNames.HIGHLIGHT_SEARCH_COLORING); - } - if (coloring != null) { - coloring.apply(ctx); - } - } - } - - } - - /** Layer covering incremental search. There are just two positions - * begining and end of the searched string - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class IncSearchLayer extends DrawLayer.AbstractLayer { - - /** Position where the searched string begins */ - int pos; - - /** Length of area to highlight */ - int len; - - /** Whether this layer is enabled */ - boolean enabled; - - boolean invert; - - public IncSearchLayer() { - super(INC_SEARCH_LAYER_NAME); - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - void setArea(int pos, int len) { - this.pos = pos; - this.len = len; - } - - public int getOffset() { - return pos; - } - - public int getLength() { - return len; - } - - public void init(DrawContext ctx) { - setNextActivityChangeOffset(enabled ? pos : Integer.MAX_VALUE); - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active = false; - if (enabled) { - if (ctx.getFragmentOffset() == pos) { - active = true; - setNextActivityChangeOffset(pos + len); - } - } - - return active; - } - - /** current INC_SEARCH_COLORING is used only in block search. - * if there is no search, use selection - * @param invert if true - selection coloring is used - */ - void setInversion(boolean invert){ - this.invert = invert; - } - - public void updateContext(DrawContext ctx) { - if (!invert) { - Coloring coloring = ctx.getEditorUI().getColoring(FontColorNames.INC_SEARCH_COLORING); - if (coloring != null) { - coloring.apply(ctx); - } - } else { - Coloring invertedColoring = ctx.getEditorUI().getColoring(FontColorNames.SELECTION_COLORING); - if (invertedColoring != null) { - invertedColoring.apply(ctx); - } - } - } - } // End of IncSearchLayer class - - /** - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class BlockSearchLayer extends DrawLayer.AbstractLayer { - - /** Position where the searched string begins */ - int pos; - - /** Length of area to highlight */ - int len; - - /** Whether this layer is enabled */ - boolean enabled; - - public BlockSearchLayer() { - super(BLOCK_SEARCH_LAYER_NAME); - } - - public boolean extendsEmptyLine(){ - return true; - } - - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - void setArea(int pos, int len) { - this.pos = pos; - this.len = len; - } - - int getOffset() { - return pos; - } - - int getLength() { - return len; - } - - public void init(DrawContext ctx) { - setNextActivityChangeOffset(enabled ? pos : Integer.MAX_VALUE); - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active = false; - if (enabled) { - int fragOffset = ctx.getFragmentOffset(); - if (fragOffset >= pos && fragOffset<(pos+len)) { - active = true; - try { - BaseDocument doc = ctx.getEditorUI().getDocument(); - int nextRowStartPos = Utilities.getRowStart( - doc, fragOffset, 1); - if (nextRowStartPos < 0) { // end of doc - nextRowStartPos = Integer.MAX_VALUE; - } - setNextActivityChangeOffset(Math.min(nextRowStartPos,(pos+len))); - - } catch (BadLocationException e) { - active = false; - } - - } - } - - return active; - } - - public void updateContext(DrawContext ctx) { - Coloring coloring = ctx.getEditorUI().getColoring(FontColorNames.BLOCK_SEARCH_COLORING); - if (coloring != null) { - coloring.apply(ctx); - } - } - } // End of BlockSearchLayer class - -// -// XXX: Deprecated and not used anymore. Can be removed. -// -// /** Layer for guarded blocks -// * -// * @deprecated Please use Highlighting SPI instead, for details see -// * Editor Library 2. -// */ -// static class GuardedLayer extends ColorLineLayer { -// -// GuardedDocument doc; -// -// GuardedLayer() { -// super(GUARDED_LAYER_NAME); -// } -// -// public void init(DrawContext ctx) { -// super.init(ctx); -// doc = (GuardedDocument)ctx.getEditorUI().getDocument(); -// } -// -// public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { -// boolean active; -// if (mark != null) { -// active = mark.activateLayer; -// } else { -// active = doc.isPosGuarded(ctx.getFragmentOffset()); -// } -// -// return active; -// } -// -// protected Coloring getColoring(DrawContext ctx) { -// return ctx.getEditorUI().getColoring(SettingsNames.GUARDED_COLORING); -// } -// -// } - - - - /** - * Style layer getting color settings from particular style - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class StyleLayer extends DrawLayer.AbstractLayer { - - protected Style style; - - protected MarkChain markChain; - - protected Color backColor; - - protected Color foreColor; - - public StyleLayer(String layerName, BaseDocument doc, Style style) { - super(layerName); - this.style = style; - markChain = new MarkChain(doc, layerName); - } - - public boolean extendsEOL() { - return true; - } - - public final MarkChain getMarkChain() { - return markChain; - } - - public void init(DrawContext ctx) { - foreColor = StyleConstants.getForeground(style); - backColor = StyleConstants.getBackground(style); - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - boolean active = false; - if (mark != null) { - active = (ctx.getEditorUI().getComponent() != null) - && mark.activateLayer; - if (active) { - try { - BaseDocument doc = ctx.getEditorUI().getDocument(); - int nextRowStartPos = Utilities.getRowStart( - doc, ctx.getFragmentOffset(), 1); - if (nextRowStartPos < 0) { // end of doc - nextRowStartPos = Integer.MAX_VALUE; - } - - setNextActivityChangeOffset(nextRowStartPos); - - } catch (BadLocationException e) { - active = false; - } - } - - } - - return active; - } - - public void updateContext(DrawContext ctx) { - if (foreColor != null) { - ctx.setForeColor(foreColor); - } - if (backColor != null) { - ctx.setBackColor(backColor); - } - } - - public String toString() { - return super.toString() + ((markChain != null) ? (", " + markChain) : ""); // NOI18N - } - - } - - /** - * Test layer for coloring the specific words - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class WordColoringLayer extends DrawLayer.AbstractLayer { - - protected StringMap stringMap = new StringMap(); - - public WordColoringLayer(String name) { - super(name); - } - - public void put(String s, Coloring c) { - stringMap.put(s, c); - } - - public void put(String[] strings, Coloring c) { - for (int i = 0; i < strings.length; i++) { - put(strings[i], c); - } - } - - public void put(List stringList, Coloring c) { - String strings[] = new String[stringList.size()]; - stringList.toArray(strings); - put(strings, c); - } - - public void init(DrawContext ctx) { - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - return true; - } - - public void updateContext(DrawContext ctx) { - Coloring c = (Coloring)stringMap.get(ctx.getBuffer(), - ctx.getTokenOffset(), ctx.getTokenLength()); - if (c != null) { - c.apply(ctx); - } - } - - } - - /** - * Annotation layer for drawing of annotations. Each mark which is stored in markChain has - * corresponding Annotation. More than one Annotation can share one mark. In this case - * the only one annotation is active and this must be drawn. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class AnnotationLayer extends DrawLayer.AbstractLayer { - - /** Current coloring */ - private Coloring coloring; - - /** Chain of marks attached to this layer */ - private MarkChain markChain; - - public AnnotationLayer(BaseDocument doc) { - super(ANNOTATION_LAYER_NAME); - coloring = null; - markChain = new MarkChain(doc, ANNOTATION_LAYER_NAME); - } - - /** Get chain of marks attached to this draw layer - * @return mark chain */ - public final MarkChain getMarkChain() { - return markChain; - } - - public boolean extendsEOL() { - return true; - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - int nextActivityOffset; - coloring = null; -// LOG.setLevel(Level.FINE); -// if (LOG.isLoggable(Level.FINE)) { -// LOG.fine(" ctx-offset=" + ctx.getFragmentOffset() + ", mark=" + mark + '\n'); -// } - - if (mark == null) { - View view = ctx instanceof DrawEngine.DrawInfo ? ((DrawEngine.DrawInfo)ctx).view : null; - if (view instanceof DrawEngineLineView) { - mark = getFoldedMark((DrawEngineLineView)view, getName()); - } - } - - if (mark == null) { - return false; - } - - if (ctx.getEditorUI().getComponent() == null || !mark.activateLayer) { - return false; - } - - BaseDocument doc = ctx.getEditorUI().getDocument(); - - // Gets the active annotation attached to this mark. It is possible that - // no active annotation might exist for the mark, e.g. there can be - // mark at the beginning of the line for a whole line annotation - // and there can be mark in the middle of the line for a line-part annotation - AnnotationDesc anno = doc.getAnnotations().getActiveAnnotation(mark); - if (anno == null) { - // if no active annotation was found for the given mark, check - // whether we are not already drawing some other annotation. If that's - // true we have to continue drawing it (means return true here) - AnnotationDesc activeAnno = doc.getAnnotations().getLineActiveAnnotation(mark); - if (activeAnno == null) { - return false; - } - if (ctx.getFragmentOffset() >= activeAnno.getOffset()) { - if (ctx.getFragmentOffset() < activeAnno.getOffset() + activeAnno.getLength() || activeAnno.isWholeLine()) { - coloring = activeAnno.getColoring(); - return true; - } - } - return false; - } - -// if (LOG.isLoggable(Level.FINE)) { -// LOG.log(Level.FINE, "anno: o=" + anno.getOffset() + ", l=" + anno.getLength() + ", wl=" + anno.isWholeLine() -// + ", m=" + mark + ", ctx-offset=" + ctx.getFragmentOffset() + '\n'); -// } - if (anno.isWholeLine()) { - try { - nextActivityOffset = Utilities.getRowEnd(doc, ctx.getFragmentOffset()); - } catch (BadLocationException ble) { - LOG.log(Level.FINE, null, ble); - return false; - } - } else { - if (ctx.getFragmentOffset() < anno.getOffset()) { // Queried below annotation start - setNextActivityChangeOffset(anno.getOffset()); - return false; - } - nextActivityOffset = anno.getOffset() + anno.getLength(); - if (ctx.getFragmentOffset() >= nextActivityOffset) { // Queried above annotation end - try { - setNextActivityChangeOffset(Utilities.getRowEnd(doc, ctx.getFragmentOffset())); - } catch (BadLocationException ble) { - LOG.log(Level.FINE, null, ble); - return false; - } - return false; - } - } - - setNextActivityChangeOffset(nextActivityOffset); - coloring = anno.getColoring(); - -// The following code ensures that if active annotation does not -// have highlight the color of next one will be used. -// It was decided that it will not be used -// -// if (coloring.getBackColor() == null) { -// AnnotationDesc[] annos = doc.getAnnotations().getPasiveAnnotations(anno.getLine()); -// if (annos != null) { -// for (int i=0; i> 1; - int cmp = docMarksStorage.getMarkOffsetInternal(mid) - endPos; - if (cmp < 0) - low = mid + 1; - else if (cmp > 0) - high = mid - 1; - else { // found - while (++mid <= high && docMarksStorage.getMarkOffsetInternal(mid) == endPos) { } - low = high = mid - 1; - } - } - - while (low >= 0 && low < docMarksStorage.getMarkCount()) { - MultiMark mm = (MultiMark)docMarksStorage.getMark(low--); - if (mm.isValid() && mm.getOffset() <= endPos) { - if (mm.getOffset() < startPos) { - break; - } - Mark mrk = doc.marks.get(mm); - if (mrk instanceof MarkFactory.DrawMark && layerName.equals(((MarkFactory.DrawMark)mrk).layerName)) { - return (MarkFactory.DrawMark)mrk; - } - } - } - } - - return null; - } -} --- a/editor.lib/src/org/netbeans/editor/EditorUI.java +++ a/editor.lib/src/org/netbeans/editor/EditorUI.java @@ -90,6 +90,8 @@ import org.netbeans.modules.editor.lib2.EditorPreferencesKeys; import org.netbeans.modules.editor.lib.KitsTracker; import org.netbeans.modules.editor.lib.SettingsConversions; +import org.netbeans.modules.editor.lib.drawing.EditorUiAccessor; +import org.netbeans.modules.editor.lib.drawing.HighlightingDrawLayer; import org.openide.util.WeakListeners; /** @@ -156,9 +158,6 @@ /** Document for the case ext ui is constructed without the component */ private BaseDocument printDoc; - /** Draw layer chain */ - private DrawLayerList drawLayerList = new DrawLayerList(); - /** Map holding the [name, coloring] pairs */ private ColoringMap coloringMap; @@ -289,7 +288,6 @@ } }; - HighlightingDrawLayer.hookUp(this); getToolTipSupport(); } @@ -316,9 +314,6 @@ setLineNumberEnabled(lineNumberEnabled); updateLineNumberWidth(0); - - drawLayerList.add(printDoc.getDrawLayerList()); - HighlightingDrawLayer.hookUp(this); } /** @@ -366,7 +361,10 @@ // initialize rendering hints FontColorSettings fcs = MimeLookup.getLookup(mimePath).lookup(FontColorSettings.class); renderingHints = (Map) fcs.getFontColors(FontColorNames.DEFAULT_COLORING).getAttribute(EditorStyleConstants.RenderingHints); - + + // Initialize draw layers + HighlightingDrawLayer.hookUp(c); + synchronized (getComponentLock()) { this.component = c; @@ -562,17 +560,10 @@ } protected void modelChanged(BaseDocument oldDoc, BaseDocument newDoc) { - if (oldDoc != null) { - // remove all document layers - drawLayerList.remove(oldDoc.getDrawLayerList()); - } - if (newDoc != null) { coloringMap = ColoringMap.get(Utilities.getMimeType(newDoc)); listener.preferenceChange(null); - // add all document layers - drawLayerList.add(newDoc.getDrawLayerList()); checkUndoManager(newDoc); } } @@ -963,49 +954,6 @@ return statusBar; } - - final DrawLayerList getDrawLayerList() { - return drawLayerList; - } - - /** - * Find the layer with some layer name in the layer hierarchy. - * - *

Using of DrawLayers has been deprecated. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public DrawLayer findLayer(String layerName) { - return drawLayerList.findLayer(layerName); - } - - /** - * Add new layer and use its priority to position it in the chain. - * If there's the layer with same visibility then the inserted layer - * will be placed after it. - * - *

Using of DrawLayers has been deprecated. - * - * @param layer layer to insert into the chain - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public boolean addLayer(DrawLayer layer, int visibility) { - return drawLayerList.add(layer, visibility); - } - - /** - * Using of DrawLayers has been deprecated. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public DrawLayer removeLayer(String layerName) { - return drawLayerList.remove(layerName); - } - public void repaint(int startY) { repaint(startY, component.getHeight()); } @@ -1767,4 +1715,103 @@ public void setPopupMenu(JPopupMenu popupMenu) { this.popupMenu = popupMenu; } + + static { + EditorUiAccessor.register(new Accessor()); + } + + private static final class Accessor extends EditorUiAccessor { + + @Override + public boolean isLineNumberVisible(EditorUI eui) { + return eui.lineNumberVisible; + } + + @Override + public Coloring getColoring(EditorUI eui, String coloringName) { + return eui.getColoring(coloringName); + } + + @Override + public int getLineNumberMaxDigitCount(EditorUI eui) { + return eui.lineNumberMaxDigitCount; + } + + @Override + public int getLineNumberWidth(EditorUI eui) { + return eui.lineNumberWidth; + } + + @Override + public int getLineNumberDigitWidth(EditorUI eui) { + return eui.lineNumberDigitWidth; + } + + @Override + public Insets getLineNumberMargin(EditorUI eui) { + return eui.getLineNumberMargin(); + } + + @Override + public int getLineHeight(EditorUI eui) { + return eui.getLineHeight(); + } + + @Override + public Coloring getDefaultColoring(EditorUI eui) { + return eui.getDefaultColoring(); + } + + @Override + public int getDefaultSpaceWidth(EditorUI eui) { + return eui.defaultSpaceWidth; + } + + @Override + public Map getRenderingHints(EditorUI eui) { + return eui.renderingHints; + } + + @Override + public Rectangle getExtentBounds(EditorUI eui) { + return eui.getExtentBounds(); + } + + @Override + public Insets getTextMargin(EditorUI eui) { + return eui.getTextMargin(); + } + + @Override + public int getTextLeftMarginWidth(EditorUI eui) { + return eui.textLeftMarginWidth; + } + + @Override + public boolean getTextLimitLineVisible(EditorUI eui) { + return eui.textLimitLineVisible; + } + + @Override + public Color getTextLimitLineColor(EditorUI eui) { + return eui.getTextLimitLineColor(); + } + + @Override + public int getTextLimitWidth(EditorUI eui) { + return eui.textLimitWidth; + } + + @Override + public int getLineAscent(EditorUI eui) { + return eui.getLineAscent(); + } + + @Override + public void paint(EditorUI eui, Graphics g) { + eui.paint(g); + } + + } // End of Accessor class + } --- a/editor.lib/src/org/netbeans/editor/GuardedDocument.java +++ a/editor.lib/src/org/netbeans/editor/GuardedDocument.java @@ -42,7 +42,6 @@ package org.netbeans.editor; import java.text.MessageFormat; -import java.util.Hashtable; import java.util.Enumeration; import java.awt.Color; import java.awt.Font; @@ -105,9 +104,6 @@ /** Style context to hold the styles */ protected StyleContext styles; - /** Style to layer name mapping */ - protected Hashtable stylesToLayers; - /** Name of the normal style. The normal style is used to reset the effect * of all styles applied to the line. */ @@ -169,7 +165,6 @@ private void init(StyleContext styles) { this.styles = styles; - stylesToLayers = new Hashtable(5); guardedBlockChain = new MarkBlockChain(this) { protected @Override Mark createBlockStartMark() { MarkFactory.ContextMark startMark = new MarkFactory.ContextMark(Position.Bias.Forward, false); @@ -300,17 +295,6 @@ } } - public void setCharacterAttributes(int offset, int length, AttributeSet attribs, boolean replace) { - if (((Boolean)attribs.getAttribute(GUARDED_ATTRIBUTE)).booleanValue() == true) { - guardedBlockChain.addBlock(offset, offset + length, false); // no concat - fireChangedUpdate(getDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE, attribs)); - } - if (((Boolean)attribs.getAttribute(GUARDED_ATTRIBUTE)).booleanValue() == false) { - guardedBlockChain.removeBlock(offset, offset + length); - fireChangedUpdate(getDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE, attribs)); - } - } - public @Override void runAtomic(Runnable r) { if (debugAtomic) { System.out.println("GuardedDocument.runAtomic() called"); // NOI18N @@ -376,30 +360,28 @@ return new GuardedDocumentEvent(this, offset, length, type); } + /** Set the name for normal style. Normal style is used to reset the effect + * of all aplied styles. + */ + public void setNormalStyleName(String normalStyleName) { + this.normalStyleName = normalStyleName; + } + + /** Fetches the list of style names */ + public Enumeration getStyleNames() { + return styles.getStyleNames(); + } + + // ------------------------------------------------------------------------ + // StyleDocument implementation + // ------------------------------------------------------------------------ + /** Adds style to the document */ public Style addStyle(String styleName, Style parent) { - String layerName = (String)stylesToLayers.get(styleName); - if (layerName == null) { - layerName = styleName; // same layer name as style name - addStyleToLayerMapping(styleName, layerName); - } - Style style = styles.addStyle(styleName, parent); - if (findLayer(layerName) == null) { // not created by default - readLock(); - try { - addStyledLayer(layerName, style); - } finally { - readUnlock(); - } - } return style; } - public void addStyleToLayerMapping(String styleName, String layerName) { - stylesToLayers.put(styleName, layerName); - } - /** Removes style from document */ public void removeStyle(String styleName) { styles.removeStyle(styleName); @@ -410,16 +392,15 @@ return styles.getStyle(styleName); } - /** Set the name for normal style. Normal style is used to reset the effect - * of all aplied styles. - */ - public void setNormalStyleName(String normalStyleName) { - this.normalStyleName = normalStyleName; - } - - /** Fetches the list of style names */ - public Enumeration getStyleNames() { - return styles.getStyleNames(); + public void setCharacterAttributes(int offset, int length, AttributeSet attribs, boolean replace) { + if (((Boolean)attribs.getAttribute(GUARDED_ATTRIBUTE)).booleanValue() == true) { + guardedBlockChain.addBlock(offset, offset + length, false); // no concat + fireChangedUpdate(getDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE, attribs)); + } + if (((Boolean)attribs.getAttribute(GUARDED_ATTRIBUTE)).booleanValue() == false) { + guardedBlockChain.removeBlock(offset, offset + length); + fireChangedUpdate(getDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE, attribs)); + } } /** Change attributes for part of the text. */ @@ -440,49 +421,11 @@ * @param s the style to set */ public void setLogicalStyle(int pos, Style s) { - readLock(); - try { - pos = Utilities.getRowStart(this, pos); - String layerName = (String)stylesToLayers.get(s.getName()); - // remove all applied styles - DrawLayer[] layerArray = getDrawLayerList().currentLayers(); - for (int i = 0; i < layerArray.length; i++) { - if (layerArray[i] instanceof DrawLayerFactory.StyleLayer) { - ((DrawLayerFactory.StyleLayer)layerArray[i]).markChain.removeMark(pos); - } - } - // now set the requested style - DrawLayerFactory.StyleLayer styleLayer - = (DrawLayerFactory.StyleLayer)findLayer(layerName); - if (styleLayer != null) { - styleLayer.markChain.addMark(pos); - } - fireChangedUpdate(getDocumentEvent( - pos, 0, DocumentEvent.EventType.CHANGE, null)); // enough to say length 0 - } catch (BadLocationException e) { - // do nothing for invalid positions - } finally { - readUnlock(); - } } /** Get logical style for position in paragraph */ public Style getLogicalStyle(int pos) { - try { - pos = Utilities.getRowStart(this, pos); - DrawLayer[] layerArray = getDrawLayerList().currentLayers(); - for (int i = 0; i < layerArray.length; i++) { - DrawLayer layer = layerArray[i]; - if (layer instanceof DrawLayerFactory.StyleLayer) { - if (((DrawLayerFactory.StyleLayer)layer).markChain.isMark(pos)) { - return ((DrawLayerFactory.StyleLayer)layer).style; - } - } - } - return getStyle(normalStyleName); // no style found - } catch (BadLocationException e) { - return null; - } + return null; } /** @@ -534,32 +477,8 @@ return new Font("Default",Font.BOLD,12); // NOI18N } - /** - * Using of DrawLayers has been deprecated. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - protected DrawLayer addStyledLayer(String layerName, Style style) { - if (layerName != null) { - try { - int indColon = layerName.indexOf(':'); //NOI18N - int layerVisibility = Integer.parseInt(layerName.substring(indColon + 1)); - DrawLayer layer = new DrawLayerFactory.StyleLayer(layerName, this, style); - - addLayer(layer, layerVisibility); - return layer; - - } catch (NumberFormatException e) { - // wrong name, let it pass - } - } - return null; - } - public @Override String toStringDetail() { return super.toStringDetail() - + getDrawLayerList() + ",\nGUARDED blocks:\n" + guardedBlockChain; // NOI18N } --- a/editor.lib/src/org/netbeans/editor/LeafView.java +++ a/editor.lib/src/org/netbeans/editor/LeafView.java @@ -51,6 +51,9 @@ import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.event.DocumentEvent; +import org.netbeans.modules.editor.lib.drawing.DrawContext; +import org.netbeans.modules.editor.lib.drawing.DrawEngine; +import org.netbeans.modules.editor.lib.drawing.DrawGraphics; /** * Leaf view implementation. This corresponds and requires leaf element @@ -103,17 +106,17 @@ protected int mainHeight; /** Draw graphics for converting position to coords */ - ModelToViewDG modelToViewDG = new ModelToViewDG(); + final ModelToViewDG modelToViewDG = new ModelToViewDG(); /** Draw graphics for converting coords to position */ - ViewToModelDG viewToModelDG = new ViewToModelDG(); + final ViewToModelDG viewToModelDG = new ViewToModelDG(); /** Construct new base view */ public LeafView(Element elem) { super(elem); } - public void setParent(View parent) { + public @Override void setParent(View parent) { super.setParent(parent); if (getParent() != null) { @@ -173,7 +176,8 @@ int pos = getPosFromY(clipY + clipHeight - 1); int endPos = Utilities.getRowEnd(doc, pos); int baseY = getYFromPos(startPos); - DrawEngine.getDrawEngine().draw(new DrawGraphics.GraphicsDG(g), + DrawEngine.getDrawEngine().draw( + new DrawGraphics.GraphicsDG(g), editorUI, startPos, endPos, getBaseX(baseY), baseY, Integer.MAX_VALUE ); @@ -249,17 +253,17 @@ } /** Returns the number of child views in this view. */ - public final int getViewCount() { + public @Override final int getViewCount() { return 0; } /** Gets the n-th child view. */ - public final View getView(int n) { + public @Override final View getView(int n) { return null; } /** !!! osetrit konec view -> jump na dalsi v branchview */ - public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, + public @Override int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException { if (biasRet != null) { @@ -342,7 +346,7 @@ return ret; } - public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, + public @Override Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { Rectangle r0 = (Rectangle)modelToView(p0, a, b0); Rectangle r1 = (Rectangle)modelToView(p1, a, b1); @@ -413,7 +417,7 @@ * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children */ - public void insertUpdate(DocumentEvent evt, Shape a, ViewFactory f) { + public @Override void insertUpdate(DocumentEvent evt, Shape a, ViewFactory f) { try { BaseDocumentEvent bevt = (BaseDocumentEvent)evt; EditorUI editorUI = getEditorUI(); @@ -449,7 +453,7 @@ * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children */ - public void removeUpdate(DocumentEvent evt, Shape a, ViewFactory f) { + public @Override void removeUpdate(DocumentEvent evt, Shape a, ViewFactory f) { try { BaseDocumentEvent bevt = (BaseDocumentEvent)evt; EditorUI editorUI = getEditorUI(); @@ -482,7 +486,7 @@ * @param a the current allocation of the view * @param f the factory to use to rebuild if the view has children */ - public void changedUpdate(DocumentEvent evt, Shape a, ViewFactory f) { + public @Override void changedUpdate(DocumentEvent evt, Shape a, ViewFactory f) { try { if (getComponent().isShowing()) { getEditorUI().repaintBlock(evt.getOffset(), evt.getOffset() + evt.getLength()); @@ -501,7 +505,7 @@ Rectangle r; - public boolean targetOffsetReached(int pos, char ch, int x, + public @Override boolean targetOffsetReached(int pos, char ch, int x, int charWidth, DrawContext ctx) { r.x = x; r.y = getY(); @@ -533,7 +537,7 @@ return offset; } - public boolean targetOffsetReached(int offset, char ch, int x, + public @Override boolean targetOffsetReached(int offset, char ch, int x, int charWidth, DrawContext ctx) { if (offset <= eolOffset) { if (x + charWidth < targetX) { --- a/editor.lib/src/org/netbeans/editor/Mark.java +++ a/editor.lib/src/org/netbeans/editor/Mark.java @@ -48,6 +48,7 @@ import javax.swing.text.Element; import javax.swing.text.Position; import javax.swing.text.Position.Bias; +import org.netbeans.modules.editor.lib.impl.MultiMark; /** * Marks hold the relative position in the document. --- a/editor.lib/src/org/netbeans/editor/MarkBlockChain.java +++ a/editor.lib/src/org/netbeans/editor/MarkBlockChain.java @@ -44,7 +44,6 @@ import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import javax.swing.text.BadLocationException; -import javax.swing.text.Position; /** * Support class for chain of MarkBlocks @@ -354,33 +353,7 @@ return pos; } - public static class LayerChain extends MarkBlockChain { - - private String layerName; - - public LayerChain(BaseDocument doc, String layerName) { - super(doc); - this.layerName = layerName; - } - - public final String getLayerName() { - return layerName; - } - - protected Mark createBlockStartMark() { - MarkFactory.DrawMark startMark = new MarkFactory.DrawMark(layerName, null); - startMark.activateLayer = true; - return startMark; - } - - protected Mark createBlockEndMark() { - MarkFactory.DrawMark endMark = new MarkFactory.DrawMark(layerName, null, Position.Bias.Backward); - return endMark; - } - - } - - public String toString() { + public @Override String toString() { return "MarkBlockChain: currentBlock=" + currentBlock + "\nblock chain: " // NOI18N + (chain != null ? ("\n" + chain.toStringChain()) : " Empty"); // NOI18N } --- a/editor.lib/src/org/netbeans/editor/MarkFactory.java +++ a/editor.lib/src/org/netbeans/editor/MarkFactory.java @@ -41,7 +41,6 @@ package org.netbeans.editor; -import java.lang.ref.WeakReference; import javax.swing.text.Position; /** @@ -97,7 +96,7 @@ } /** When removal occurs */ - protected void removeUpdateAction(int pos, int len) { + protected @Override void removeUpdateAction(int pos, int len) { try { remove(); } catch (InvalidMarkException e) { @@ -124,176 +123,4 @@ } - /** Activation mark for particular layer. When layer is not active - * its updateContext() method is not called. - */ - public static class DrawMark extends ContextMark { - - /** Activation flag means either activate layer or deactivate it */ - protected boolean activateLayer; - - /** Reference to draw layer this mark belogns to */ - String layerName; - - /** Reference to extended UI if this draw mark is info-specific or - * null if it's document-wide. - */ - WeakReference editorUIRef; - - public DrawMark(String layerName, EditorUI editorUI) { - this(layerName, editorUI, Position.Bias.Forward); - } - - public DrawMark(String layerName, EditorUI editorUI, Position.Bias bias) { - super(bias, false); - this.layerName = layerName; - setEditorUI(editorUI); - } - - public boolean isDocumentMark() { - return (editorUIRef == null); - } - - public EditorUI getEditorUI() { - if (editorUIRef != null) { - return (EditorUI)editorUIRef.get(); - } - return null; - } - - public void setEditorUI(EditorUI editorUI) { - this.editorUIRef = (editorUI != null) ? new WeakReference(editorUI) : null; - } - - public boolean isValidUI() { - return !(editorUIRef != null && editorUIRef.get() == null); - } - - public void setActivateLayer(boolean activateLayer) { - this.activateLayer = activateLayer; - } - - public boolean getActivateLayer() { - return activateLayer; - } - - public boolean removeInvalid() { - if (!isValidUI() && isValid()) { - try { - this.remove(); - } catch (InvalidMarkException e) { - throw new IllegalStateException(e.toString()); - } - return true; // invalid and removed - } - return false; // valid - } - - public String toString() { - try { - return "pos=" + getOffset() + ", line=" + getLine(); // NOI18N - } catch (InvalidMarkException e) { - return "mark not valid"; // NOI18N - } - } - - } - - /** Support for draw marks chained in double linked list */ - public static class ChainDrawMark extends DrawMark { - - /** Next mark in chain */ - protected ChainDrawMark next; - - /** Previous mark in chain */ - protected ChainDrawMark prev; - - public ChainDrawMark(String layerName, EditorUI editorUI) { - this(layerName, editorUI, Position.Bias.Forward); - } - - public ChainDrawMark(String layerName, EditorUI editorUI, Position.Bias bias) { - super(layerName, editorUI, bias); - } - - public final ChainDrawMark getNext() { - return next; - } - - public final void setNext(ChainDrawMark mark) { - next = mark; - } - - /** Set next mark in chain */ - public void setNextChain(ChainDrawMark mark) { - this.next = mark; - if (mark != null) { - mark.prev = this; - } - } - - public final ChainDrawMark getPrev() { - return prev; - } - - public final void setPrev(ChainDrawMark mark) { - prev = mark; - } - - /** Set previous mark in chain */ - public void setPrevChain(ChainDrawMark mark) { - this.prev = mark; - if (mark != null) { - mark.next = this; - } - } - - /** Insert mark before this one in chain - * @return inserted mark - */ - public ChainDrawMark insertChain(ChainDrawMark mark) { - ChainDrawMark thisPrev = this.prev; - mark.prev = thisPrev; - mark.next = this; - if (thisPrev != null) { - thisPrev.next = mark; - } - this.prev = mark; - return mark; - } - - /** Remove this mark from the chain - * @return next chain member or null for end of chain - */ - public ChainDrawMark removeChain() { - ChainDrawMark thisNext = this.next; - ChainDrawMark thisPrev = this.prev; - if (thisPrev != null) { // not the first - thisPrev.next = thisNext; - this.prev = null; - } - if (thisNext != null) { // not the last - thisNext.prev = thisPrev; - this.next = null; - } - try { - this.remove(); // remove the mark from DocMarks - } catch (InvalidMarkException e) { - // already removed - } - return thisNext; - } - - public String toStringChain() { - return toString() + (next != null ? "\n" + next.toStringChain() : ""); // NOI18N - } - - public String toString() { - return super.toString() + ", " // NOI18N - + ((prev != null) ? ((next != null) ? "chain member" // NOI18N - : "last member") : ((next != null) ? "first member" // NOI18N - : "standalone member")); // NOI18N - } - - } } --- a/editor.lib/src/org/netbeans/editor/Utilities.java +++ a/editor.lib/src/org/netbeans/editor/Utilities.java @@ -62,6 +62,7 @@ import org.netbeans.api.editor.EditorRegistry; import org.netbeans.lib.editor.util.CharSequenceUtilities; import org.netbeans.lib.editor.util.swing.DocumentUtilities; +import org.netbeans.modules.editor.lib.drawing.DrawEngineDocView; import org.netbeans.modules.editor.lib2.EditorPreferencesKeys; import org.openide.util.NbBundle; --- a/editor.lib/src/org/netbeans/editor/ext/ExtCaret.java +++ a/editor.lib/src/org/netbeans/editor/ext/ExtCaret.java @@ -52,216 +52,8 @@ public class ExtCaret extends BaseCaret { - /** - * Highlight row draw layer name. - * - *

Using DrawLayers has been deprecated and this constant - * has no longer any meaning. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static final String HIGHLIGHT_ROW_LAYER_NAME = "highlight-row-layer"; // NOI18N - - /** - * Highlight row draw layer visibility. - * - *

Using DrawLayers has been deprecated and this constant - * has no longer any meaning. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static final int HIGHLIGHT_ROW_LAYER_VISIBILITY = 2050; - - /** - * Highlight matching brace draw layer name - * - * @deprecated Please use Braces Matching SPI instead, for details see - * Editor Braces Matching. - */ - public static final String HIGHLIGHT_BRACE_LAYER_NAME = "highlight-brace-layer"; // NOI18N - - /** - * Highlight matching brace draw layer visibility - * - * @deprecated Please use Braces Matching SPI instead, for details see - * Editor Braces Matching. - */ - public static final int HIGHLIGHT_BRACE_LAYER_VISIBILITY = 11000; - -// XXX: remove -// /** Highlight a brace matching character before the caret */ -// public static final int MATCH_BRACE_BEFORE = -1; -// -// /** Highlight a brace matching character after (at) the caret */ -// public static final int MATCH_BRACE_AFTER = 0; -// -// /** Highlight a brace matching character either before or after caret; -// the character before takes precedence. */ -// public static final int MATCH_BRACE_EITHER = java.lang.Integer.MAX_VALUE; -// -// /** Whether to hightlight the matching brace */ -// boolean highlightBrace; -// -// /** Coloring used for highlighting the matching brace */ -// Coloring highlightBraceColoring; -// -// /** Mark holding the starting position of the matching brace. */ -// MarkFactory.DrawMark highlightBraceStartMark; -// -// /** Mark holding the ending position of the matching brace. */ -// MarkFactory.DrawMark highlightBraceEndMark; -// -// /** Timer that fires when the matching brace should be displayed */ -// private Timer braceTimer; -// private ActionListener braceTimerListener; // because of unwanted GC -// -// /** Signal that the next matching brace update -// * will be immediate without waiting for the brace -// * timer to fire the action. -// */ -// private boolean matchBraceUpdateSync; -// -// /** Whether the brace starting and ending marks are currently valid or not. -// * If they are not valid the block they delimit is not highlighted. -// */ -// boolean braceMarksValid; -// -// boolean simpleMatchBrace; -// -// private int matchBraceOffset = MATCH_BRACE_EITHER; - static final long serialVersionUID =-4292670043122577690L; -// XXX: remove -// protected void modelChanged(BaseDocument oldDoc, BaseDocument newDoc) { -// // Fix for #7108 -// braceMarksValid = false; // brace marks are out of date - new document -// if (highlightBraceStartMark != null) { -// try { -// highlightBraceStartMark.remove(); -// } catch (InvalidMarkException e) { -// } -// highlightBraceStartMark = null; -// } -// -// if (highlightBraceEndMark != null) { -// try { -// highlightBraceEndMark.remove(); -// } catch (InvalidMarkException e) { -// } -// highlightBraceEndMark = null; -// } -// -// super.modelChanged( oldDoc, newDoc ); -// } - -// XXX: remove -// /** Called when settings were changed. The method is called -// * also in constructor, so the code must count with the evt being null. -// */ -// public void settingsChange(SettingsChangeEvent evt) { -// super.settingsChange(evt); -// JTextComponent c = component; -// if (c != null) { -// Class kitClass = Utilities.getKitClass(c); -//// XXX: remove -//// EditorUI editorUI = Utilities.getEditorUI(c); -//// highlightBraceColoring = editorUI.getColoring( -//// ExtSettingsNames.HIGHLIGHT_MATCH_BRACE_COLORING); -//// -//// highlightBrace = SettingsUtil.getBoolean(kitClass, -//// ExtSettingsNames.HIGHLIGHT_MATCH_BRACE, -//// ExtSettingsDefaults.defaultHighlightMatchBrace); -//// int highlightBraceDelay = SettingsUtil.getInteger(kitClass, -//// ExtSettingsNames.HIGHLIGHT_MATCH_BRACE_DELAY, -//// ExtSettingsDefaults.defaultHighlightMatchBraceDelay); -//// -//// if (highlightBrace) { -//// if (highlightBraceDelay > 0) { -//// // jdk12 compiler doesn't allow inside run() -//// final JTextComponent c2 = component; -//// -//// braceTimer = new Timer(highlightBraceDelay, null); -//// braceTimerListener = -//// new ActionListener() { -//// public void actionPerformed(ActionEvent evt2) { -//// SwingUtilities.invokeLater( -//// new Runnable() { -//// public void run() { -//// if (c2 != null) { -//// BaseDocument doc = Utilities.getDocument(c2); -//// if( doc != null ) { -//// doc.readLock(); -//// try { -//// updateMatchBrace(); -//// } finally { -//// doc.readUnlock(); -//// } -//// } -//// } -//// } -//// } -//// ); -//// } -//// }; -//// -//// braceTimer.addActionListener(new WeakTimerListener(braceTimerListener)); -//// braceTimer.setRepeats(false); -//// } else { -//// braceTimer = null; // signal no delay -//// } -//// c.repaint(); -//// } -//// -//// simpleMatchBrace = SettingsUtil.getBoolean(kitClass, -//// ExtSettingsNames.CARET_SIMPLE_MATCH_BRACE, -//// ExtSettingsDefaults.defaultCaretSimpleMatchBrace); -//// -// popupMenuEnabled = SettingsUtil.getBoolean(kitClass, -// ExtSettingsNames.POPUP_MENU_ENABLED, true); -// } -// } -// XXX: remove -// public void install(JTextComponent c) { -// EditorUI editorUI = Utilities.getEditorUI(c); -// editorUI.addLayer(new HighlightBraceLayer(), HIGHLIGHT_BRACE_LAYER_VISIBILITY); -// super.install(c); -// } -// -// public void deinstall(JTextComponent c) { -// EditorUI editorUI = Utilities.getEditorUI(c); -// editorUI.removeLayer(HIGHLIGHT_BRACE_LAYER_NAME); -// super.deinstall(c); -// } -// -// /** Set the match brace offset. -// * @param offset One of MATCH_BRACE_BEFORE, -// * MATCH_BRACE_AFTER * or MATCH_BRACE_EITHER. -// */ -// public void setMatchBraceOffset(int offset) { -// if(offset != MATCH_BRACE_BEFORE && offset != MATCH_BRACE_AFTER -// && offset != MATCH_BRACE_EITHER) { -// throw new IllegalArgumentException("Offset "+ offset + " not allowed\n"); -// } -// matchBraceOffset = offset; -// BaseDocument doc = Utilities.getDocument(component); -// if( doc != null ) { -// doc.readLock(); -// try { -// updateMatchBrace(); -// } finally { -// doc.readUnlock(); -// } -// } -// } -// -// /** Fetch the match brace offset. */ -// public int getMatchBraceOffset() { -// return matchBraceOffset; -// } - /** * Update the matching brace of the caret. The document is read-locked * while this method is called. @@ -270,82 +62,7 @@ * Editor Braces Matching. */ protected void updateMatchBrace() { -// XXX: remove -// JTextComponent c = component; -// if (c != null && highlightBrace) { -// try { -// EditorUI editorUI = Utilities.getEditorUI(c); -// BaseDocument doc = (BaseDocument)c.getDocument(); -// int dotPos = getDot(); -// ExtSyntaxSupport sup = (ExtSyntaxSupport)doc.getSyntaxSupport(); -// boolean madeValid = false; // whether brace marks display were validated -// int[] matchBlk = null; -// if(dotPos > 0 && (matchBraceOffset == MATCH_BRACE_BEFORE -// || matchBraceOffset == MATCH_BRACE_EITHER)) { -// matchBlk = sup.findMatchingBlock(dotPos - 1, simpleMatchBrace); -// } -// if(matchBlk == null && (matchBraceOffset == MATCH_BRACE_AFTER -// || matchBraceOffset == MATCH_BRACE_EITHER)) { -// matchBlk = sup.findMatchingBlock(dotPos, simpleMatchBrace); -// } -// if (matchBlk != null) { -// if (highlightBraceStartMark != null) { -// int markStartPos = highlightBraceStartMark.getOffset(); -// int markEndPos = highlightBraceEndMark.getOffset(); -// if (markStartPos != matchBlk[0] || markEndPos != matchBlk[1]) { -// editorUI.repaintBlock(markStartPos, markEndPos); -// Utilities.moveMark(doc, highlightBraceStartMark, matchBlk[0]); -// Utilities.moveMark(doc, highlightBraceEndMark, matchBlk[1]); -// editorUI.repaintBlock(matchBlk[0], matchBlk[1]); -// } else { // on the same position -// if (!braceMarksValid) { // was not valid, must repaint -// editorUI.repaintBlock(matchBlk[0], matchBlk[1]); -// } -// } -// } else { // highlight mark is null -// highlightBraceStartMark = new MarkFactory.DrawMark( -// HIGHLIGHT_BRACE_LAYER_NAME, editorUI); -// highlightBraceEndMark = new MarkFactory.DrawMark( -// HIGHLIGHT_BRACE_LAYER_NAME, editorUI); -// highlightBraceStartMark.setActivateLayer(true); -// Utilities.insertMark(doc, highlightBraceStartMark, matchBlk[0]); -// Utilities.insertMark(doc, highlightBraceEndMark, matchBlk[1]); -// editorUI.repaintBlock(matchBlk[0], matchBlk[1]); -// } -// braceMarksValid = true; -// madeValid = true; -// } -// -// if (!madeValid) { -// if (braceMarksValid) { -// braceMarksValid = false; -// editorUI.repaintBlock(highlightBraceStartMark.getOffset(), -// highlightBraceEndMark.getOffset()); -// } -// } -// } catch (BadLocationException e) { -// Utilities.annotateLoggable(e); -// highlightBrace = false; -// } catch (InvalidMarkException e) { -// Utilities.annotateLoggable(e); -// highlightBrace = false; -// } -// } } -// XXX: remove -// protected void update(boolean scrollViewToCaret) { -// if (highlightBrace) { -// if (matchBraceUpdateSync || braceTimer == null) { -// updateMatchBrace(); -// matchBraceUpdateSync = false; -// -// } else { // delay the brace update -// braceTimer.restart(); -// } -// } -// -// super.update(scrollViewToCaret); -// } /** * Signal that the next matching brace update @@ -357,49 +74,6 @@ * Editor Braces Matching. */ public void requestMatchBraceUpdateSync() { -// XXX: remove -// matchBraceUpdateSync = true; } -// XXX: remove -// /* package */ static boolean NO_HIGHLIGHT_BRACE_LAYER = Boolean.getBoolean("nbeditor-no-HighlightBraceLayer"); -// -// /** -// * Draw layer to highlight the matching brace. -// * -// * XXX: The HighlightBraceLayer needs to be rewritten using the new Highlighting SPI. -// */ -// class HighlightBraceLayer extends DrawLayer.AbstractLayer { -// -// public HighlightBraceLayer() { -// super(HIGHLIGHT_BRACE_LAYER_NAME); -// } -// -// public void init(DrawContext ctx) { -// } -// -// public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { -// if (!NO_HIGHLIGHT_BRACE_LAYER && braceMarksValid) { -// if (mark != null) -// return mark.getActivateLayer(); -// try { -// if (ctx.getStartOffset() > highlightBraceEndMark.getOffset()) -// return highlightBraceEndMark.getActivateLayer(); -// if (ctx.getStartOffset() > highlightBraceStartMark.getOffset()) -// return highlightBraceStartMark.getActivateLayer(); -// } catch (InvalidMarkException ex) { -// } -// } -// -// return false; -// } -// -// public void updateContext(DrawContext ctx) { -// if (!NO_HIGHLIGHT_BRACE_LAYER && highlightBraceColoring != null) { -// highlightBraceColoring.apply(ctx); -// } -// } -// -// } - } --- a/editor.lib/src/org/netbeans/modules/editor/lib/BeforeSaveTasks.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/BeforeSaveTasks.java @@ -113,7 +113,7 @@ private void runTasks() { doc.runAtomicAsUser (new Runnable () { public void run () { - CompoundEdit atomicEdit = EditorPackageAccessor.get().markAtomicEditsNonSignificant(doc); + CompoundEdit atomicEdit = EditorPackageAccessor.get().BaseDocument_markAtomicEditsNonSignificant(doc); // Since these are before-save actions they should generally not prevent // the save operation to succeed. Thus the possible exceptions thrown // by the tasks will be notified but they will not prevent the save to succeed. --- a/editor.lib/src/org/netbeans/modules/editor/lib/EditorPackageAccessor.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/EditorPackageAccessor.java @@ -41,8 +41,13 @@ package org.netbeans.modules.editor.lib; +import javax.swing.text.BadLocationException; import javax.swing.undo.CompoundEdit; import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.InvalidMarkException; +import org.netbeans.editor.Mark; +import org.netbeans.modules.editor.lib.impl.MarkVector; +import org.netbeans.modules.editor.lib.impl.MultiMark; /** @@ -54,24 +59,31 @@ public abstract class EditorPackageAccessor { - private static EditorPackageAccessor INSTANCE; + private static EditorPackageAccessor ACCESSOR = null; - public static EditorPackageAccessor get() { - if (INSTANCE == null) { - // Cause api accessor impl to get initialized - try { - Class.forName(BaseDocument.class.getName(), true, EditorPackageAccessor.class.getClassLoader()); - } catch (ClassNotFoundException e) { - // Should never happen - } - } - return INSTANCE; + public static synchronized void register(EditorPackageAccessor accessor) { + assert ACCESSOR == null : "Can't register two package accessors!"; //NOI18N + ACCESSOR = accessor; } - public static void register(EditorPackageAccessor accessor) { - INSTANCE = accessor; + public static synchronized EditorPackageAccessor get() { + // Trying to wake up BaseDocument ... + try { + Class clazz = Class.forName(BaseDocument.class.getName()); + } catch (ClassNotFoundException e) { + // ignore + } + + assert ACCESSOR != null : "There is no package accessor available!"; //NOI18N + return ACCESSOR; } - public abstract CompoundEdit markAtomicEditsNonSignificant(BaseDocument doc); + protected EditorPackageAccessor() { + } + + public abstract CompoundEdit BaseDocument_markAtomicEditsNonSignificant(BaseDocument doc); + public abstract MarkVector BaseDocument_getMarksStorage(BaseDocument doc); + public abstract Mark BaseDocument_getMark(BaseDocument doc, MultiMark multiMark); + public abstract void Mark_insert(Mark mark, BaseDocument doc, int pos) throws InvalidMarkException, BadLocationException; } --- a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/ChainDrawMark.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/ChainDrawMark.java @@ -0,0 +1,142 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.editor.lib.drawing; + +import javax.swing.text.Position; +import org.netbeans.editor.EditorUI; +import org.netbeans.editor.InvalidMarkException; + +/** Support for draw marks chained in double linked list */ +public final class ChainDrawMark extends DrawMark { + + /** Next mark in chain */ + protected ChainDrawMark next; + + /** Previous mark in chain */ + protected ChainDrawMark prev; + + public ChainDrawMark(String layerName, EditorUI editorUI) { + this(layerName, editorUI, Position.Bias.Forward); + } + + public ChainDrawMark(String layerName, EditorUI editorUI, Position.Bias bias) { + super(layerName, editorUI, bias); + } + + public final ChainDrawMark getNext() { + return next; + } + + public final void setNext(ChainDrawMark mark) { + next = mark; + } + + /** Set next mark in chain */ + public void setNextChain(ChainDrawMark mark) { + this.next = mark; + if (mark != null) { + mark.prev = this; + } + } + + public final ChainDrawMark getPrev() { + return prev; + } + + public final void setPrev(ChainDrawMark mark) { + prev = mark; + } + + /** Set previous mark in chain */ + public void setPrevChain(ChainDrawMark mark) { + this.prev = mark; + if (mark != null) { + mark.next = this; + } + } + + /** Insert mark before this one in chain + * @return inserted mark + */ + public ChainDrawMark insertChain(ChainDrawMark mark) { + ChainDrawMark thisPrev = this.prev; + mark.prev = thisPrev; + mark.next = this; + if (thisPrev != null) { + thisPrev.next = mark; + } + this.prev = mark; + return mark; + } + + /** Remove this mark from the chain + * @return next chain member or null for end of chain + */ + public ChainDrawMark removeChain() { + ChainDrawMark thisNext = this.next; + ChainDrawMark thisPrev = this.prev; + if (thisPrev != null) { // not the first + thisPrev.next = thisNext; + this.prev = null; + } + if (thisNext != null) { // not the last + thisNext.prev = thisPrev; + this.next = null; + } + try { + this.remove(); // remove the mark from DocMarks + } catch (InvalidMarkException e) { + // already removed + } + return thisNext; + } + + public String toStringChain() { + return toString() + (next != null ? "\n" + next.toStringChain() : ""); // NOI18N + } + + public @Override String toString() { + return super.toString() + ", " // NOI18N + + ((prev != null) ? ((next != null) ? "chain member" // NOI18N + : "last member") : ((next != null) ? "first member" // NOI18N + : "standalone member")); // NOI18N + } + +} --- a/editor.lib/src/org/netbeans/editor/CollapsedView.java +++ a/editor.lib/src/org/netbeans/editor/CollapsedView.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Container; import java.awt.FontMetrics; @@ -63,6 +63,14 @@ import org.netbeans.api.editor.settings.AttributesUtilities; import org.netbeans.api.editor.settings.FontColorNames; import org.netbeans.api.editor.settings.FontColorSettings; +import org.netbeans.editor.BaseKit; +import org.netbeans.editor.BaseTextUI; +import org.netbeans.editor.Coloring; +import org.netbeans.editor.EditorUI; +import org.netbeans.editor.FoldingToolTip; +import org.netbeans.editor.FontMetricsCache; +import org.netbeans.editor.PopupManager; +import org.netbeans.editor.Utilities; import org.netbeans.editor.ext.ToolTipSupport; import org.netbeans.editor.view.spi.LockView; import org.openide.util.Lookup; --- a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/ColoringAccessor.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/ColoringAccessor.java @@ -0,0 +1,73 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.editor.lib.drawing; + +import org.netbeans.editor.Coloring; + +/** + * + * @author vita + */ +public abstract class ColoringAccessor { + + private static ColoringAccessor ACCESSOR = null; + + public static synchronized void register(ColoringAccessor accessor) { + assert ACCESSOR == null : "Can't register two package accessors!"; //NOI18N + ACCESSOR = accessor; + } + + public static synchronized ColoringAccessor get() { + // Trying to wake up EditorUI ... + try { + Class clazz = Class.forName(Coloring.class.getName()); + } catch (ClassNotFoundException e) { + // ignore + } + + assert ACCESSOR != null : "There is no package accessor available!"; //NOI18N + return ACCESSOR; + } + + protected ColoringAccessor() { + } + + public abstract void apply(Coloring c, DrawContext ctx); +} --- a/editor.lib/src/org/netbeans/editor/DrawContext.java +++ a/editor.lib/src/org/netbeans/editor/DrawContext.java @@ -39,10 +39,13 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Color; import java.awt.Font; +import org.netbeans.editor.EditorUI; +import org.netbeans.editor.TokenContextPath; +import org.netbeans.editor.TokenID; /** This interface provides methods for * getting and setting various drawing attributes. --- a/editor.lib/src/org/netbeans/editor/DrawEngine.java +++ a/editor.lib/src/org/netbeans/editor/DrawEngine.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Graphics; import java.awt.Graphics2D; @@ -50,6 +50,7 @@ import java.awt.Insets; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.text.BadLocationException; @@ -59,6 +60,20 @@ import javax.swing.text.Segment; import javax.swing.text.View; import org.netbeans.api.editor.settings.FontColorNames; +import org.netbeans.editor.Analyzer; +import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.Coloring; +import org.netbeans.editor.EditorDebug; +import org.netbeans.editor.EditorUI; +import org.netbeans.editor.FontMetricsCache; +import org.netbeans.editor.InvalidMarkException; +import org.netbeans.editor.Mark; +import org.netbeans.editor.TokenContextPath; +import org.netbeans.editor.TokenID; +import org.netbeans.editor.Utilities; +import org.netbeans.modules.editor.lib.EditorPackageAccessor; +import org.netbeans.modules.editor.lib.impl.MarkVector; +import org.netbeans.modules.editor.lib.impl.MultiMark; /** * This class is responsible for drawing editor components. It's a singleton. @@ -67,7 +82,7 @@ * * @author Miloslav Metelka */ -/* package */ final class DrawEngine { +public final class DrawEngine { private static final Logger LOG = Logger.getLogger(DrawEngine.class.getName()); @@ -92,9 +107,10 @@ return drawEngine; } - private void initLineNumbering(DrawInfo ctx) { + private void initLineNumbering(DrawInfo ctx, EditorUI eui) { + EditorUiAccessor accessor = EditorUiAccessor.get(); // Resolve whether line numbers will be painted - ctx.lineNumbering = ctx.editorUI.lineNumberVisible + ctx.lineNumbering = accessor.isLineNumberVisible(eui) && ctx.drawGraphics.supportsLineNumbers(); // create buffer for showing line numbers @@ -105,7 +121,7 @@ LOG.log(Level.WARNING, null, e); } - ctx.lineNumberColoring = ctx.editorUI.getColoring(FontColorNames.LINE_NUMBER_COLORING); + ctx.lineNumberColoring = accessor.getColoring(eui, FontColorNames.LINE_NUMBER_COLORING); if (ctx.lineNumberColoring == null) { ctx.lineNumberColoring = ctx.defaultColoring; // no number coloring found @@ -128,7 +144,10 @@ lnForeColor = ctx.defaultColoring.getForeColor(); } - ctx.lineNumberChars = new char[Math.max(ctx.editorUI.lineNumberMaxDigitCount, 1)]; + ctx.lineNumberChars = new char[Math.max(accessor.getLineNumberMaxDigitCount(eui), 1)]; + ctx.lineNumberWidth = accessor.getLineNumberWidth(eui); + ctx.lineNumberDigitWidth = accessor.getLineNumberDigitWidth(eui); + ctx.lineNumberMargin = accessor.getLineNumberMargin(eui); if (ctx.graphics == null) { ctx.syncedLineNumbering = true; @@ -143,29 +162,39 @@ } } - private void initInfo(DrawInfo ctx) throws BadLocationException { + private void initInfo(DrawInfo ctx, EditorUI eui) throws BadLocationException { if (ctx.startOffset < ctx.lineStartOffset) { throw new BadLocationException("Invalid startOffset: " + ctx.startOffset + " < line start offset = " + ctx.lineStartOffset, ctx.startOffset); //NOI18N } if (ctx.endOffset > ctx.lineEndOffset) { throw new BadLocationException("Invalid endOffset: " + ctx.endOffset + " > line end offset = " + ctx.lineEndOffset, ctx.endOffset); //NOI18N } - + + EditorUiAccessor accessor = EditorUiAccessor.get(); + ctx.x = ctx.startX; ctx.y = ctx.startY; - ctx.lineHeight = ctx.editorUI.getLineHeight(); - ctx.defaultColoring = ctx.editorUI.getDefaultColoring(); + ctx.lineHeight = accessor.getLineHeight(eui); + ctx.defaultColoring = accessor.getDefaultColoring(eui); ctx.tabSize = ctx.doc.getTabSize(); + ctx.defaultSpaceWidth = accessor.getDefaultSpaceWidth(eui); ctx.fragmentOffset = ctx.startOffset; // actual painting position ctx.graphics = ctx.drawGraphics.getGraphics(); if (ctx.graphics != null) { - if (ctx.editorUI.renderingHints != null) { - ((Graphics2D)ctx.graphics).setRenderingHints(ctx.editorUI.renderingHints); + Map hints = accessor.getRenderingHints(eui); + if (hints != null) { + ((Graphics2D)ctx.graphics).setRenderingHints(hints); } } - initLineNumbering(ctx); + ctx.extentBounds = accessor.getExtentBounds(eui); + ctx.textMargin = accessor.getTextMargin(eui); + ctx.textLeftMarginWidth = accessor.getTextLeftMarginWidth(eui); + ctx.textLimitLineVisible = accessor.getTextLimitLineVisible(eui); + ctx.textLimitLineColor = accessor.getTextLimitLineColor(eui); + ctx.textLimitWidth = accessor.getTextLimitWidth(eui); + initLineNumbering(ctx, eui); // Initialize draw context ctx.foreColor = ctx.defaultColoring.getForeColor(); @@ -177,12 +206,12 @@ ctx.drawGraphics.init(ctx); ctx.drawGraphics.setDefaultBackColor(ctx.defaultColoring.getBackColor()); ctx.drawGraphics.setLineHeight(ctx.lineHeight); - ctx.drawGraphics.setLineAscent(ctx.editorUI.getLineAscent()); + ctx.drawGraphics.setLineAscent(accessor.getLineAscent(eui)); ctx.drawGraphics.setX(ctx.x); ctx.drawGraphics.setY(ctx.y); // Init all draw-layers - ctx.layers = ctx.editorUI.getDrawLayerList().currentLayers(); + ctx.layers = DrawLayerList.forComponent(ctx.component).currentLayers(); int layersLength = ctx.layers.length; ctx.layerActives = new boolean[layersLength]; ctx.layerActivityChangeOffsets = new int[layersLength]; @@ -191,8 +220,8 @@ ctx.layers[i].init(ctx); // init all layers } - ctx.drawMarkList = new ArrayList(); - MarkVector docMarksStorage = ctx.doc.marksStorage; + ctx.drawMarkList = new ArrayList(); + MarkVector docMarksStorage = EditorPackageAccessor.get().BaseDocument_getMarksStorage(ctx.doc); synchronized (docMarksStorage) { int offset = ctx.startOffset; int low = 0; @@ -226,12 +255,12 @@ break; } - Mark mark = ctx.doc.marks.get(m); + Mark mark = EditorPackageAccessor.get().BaseDocument_getMark(ctx.doc, m); if (mark == null) { throw new IllegalStateException("No mark for m=" + m); // NOI18N } - if (mark instanceof MarkFactory.DrawMark) { - ctx.drawMarkList.add((MarkFactory.DrawMark)mark); + if (mark instanceof DrawMark) { + ctx.drawMarkList.add((DrawMark)mark); } } @@ -326,9 +355,9 @@ } // Fill the DG's attributes and draw - int numX = ctx.x - ctx.editorUI.lineNumberWidth; - if (ctx.editorUI.getLineNumberMargin() != null) { - numX += ctx.editorUI.getLineNumberMargin().left; + int numX = ctx.x - ctx.lineNumberWidth; + if (ctx.lineNumberMargin != null) { + numX += ctx.lineNumberMargin.left; } ctx.drawGraphics.setX(numX); @@ -343,15 +372,13 @@ ctx.drawGraphics.setBottomBorderLineColor(ctx.bottomBorderLineColor); ctx.drawGraphics.setLeftBorderLineColor(ctx.leftBorderLineColor); ctx.drawGraphics.setFont(ctx.font); - ctx.drawGraphics.drawChars(0, ctx.lineNumberChars.length, - ctx.editorUI.lineNumberWidth); + ctx.drawGraphics.drawChars(0, ctx.lineNumberChars.length, ctx.lineNumberWidth); // When printing there should be an additional space between // line number and the text if (ctx.drawGraphics.getGraphics() == null) { ctx.drawGraphics.setBuffer(SPACE); - ctx.drawGraphics.drawChars(0, 1, - ctx.editorUI.lineNumberDigitWidth); + ctx.drawGraphics.drawChars(0, 1, ctx.lineNumberDigitWidth); } ctx.drawGraphics.setX(ctx.x); @@ -507,7 +534,7 @@ // Handle possible white space expansion and compute display width FontMetricsCache.Info fmcInfo = FontMetricsCache.getInfo(ctx.font); ctx.spaceWidth = (ctx.component != null) - ? fmcInfo.getSpaceWidth(ctx.component) : ctx.editorUI.defaultSpaceWidth; + ? fmcInfo.getSpaceWidth(ctx.component) : ctx.defaultSpaceWidth; // Compute real count of chars in fragment - can differ if tabs ctx.fragmentCharCount = ctx.fragmentLength; @@ -615,7 +642,7 @@ ctx.drawGraphics.setBackColor(ctx.backColor); ctx.drawGraphics.fillRect(blankWidth); - if (emptyLine && ctx.x <= ctx.editorUI.getTextMargin().left) { //#58652 + if (emptyLine && ctx.x <= ctx.textMargin.left) { //#58652 ctx.x += blankWidth; } } @@ -912,12 +939,12 @@ private void drawTheRestOfTextLine(DrawInfo ctx) { handleEOL(ctx); - if (ctx.editorUI.textLimitLineVisible) { // draw limit line - int lineX = ctx.editorUI.getTextMargin().left + ctx.getEditorUI().textLimitWidth() * ctx.editorUI.defaultSpaceWidth; + if (ctx.textLimitLineVisible) { // draw limit line + int lineX = ctx.textMargin.left + ctx.textLimitWidth * ctx.defaultSpaceWidth; if (ctx.graphics !=null){ - ctx.graphics.setColor(ctx.editorUI.getTextLimitLineColor()); + ctx.graphics.setColor(ctx.textLimitLineColor); Rectangle clip = ctx.graphics.getClipBounds(); - if (clip.height>ctx.editorUI.getLineHeight()){ + if (clip.height>ctx.lineHeight){ ctx.graphics.drawLine(lineX, ctx.y, lineX, ctx.y+clip.height); } } @@ -925,11 +952,10 @@ } private void graphicsSpecificUpdates(DrawInfo ctx) { - Rectangle bounds = ctx.editorUI.getExtentBounds(); + Rectangle bounds = ctx.extentBounds; Rectangle clip = ctx.graphics.getClipBounds(); - Insets textMargin = ctx.editorUI.getTextMargin(); - int leftMarginWidth = textMargin.left - ctx.editorUI.lineNumberWidth - - ctx.editorUI.textLeftMarginWidth; + Insets textMargin = ctx.textMargin; + int leftMarginWidth = textMargin.left - ctx.lineNumberWidth - ctx.textLeftMarginWidth; // Draw line numbers bar and all the line nummbers if (ctx.lineNumbering && !ctx.syncedLineNumbering) { @@ -938,7 +964,7 @@ int lnBarX = bounds.x + leftMarginWidth; if (!lnBackColor.equals(ctx.defaultColoring.getBackColor()) || bounds.x > 0) { ctx.graphics.setColor(lnBackColor); - ctx.graphics.fillRect(lnBarX, numY, ctx.editorUI.lineNumberWidth, + ctx.graphics.fillRect(lnBarX, numY, ctx.lineNumberWidth, ctx.lineIndex * ctx.lineHeight); // can't use dg because of height } @@ -946,8 +972,8 @@ int lastDigitInd = Math.max(ctx.lineNumberChars.length - 1, 0); int numX = lnBarX; - if (ctx.editorUI.getLineNumberMargin() != null) { - numX += ctx.editorUI.getLineNumberMargin().left; + if (ctx.lineNumberMargin != null) { + numX += ctx.lineNumberMargin.left; } ctx.bol = true; // @@ -998,11 +1024,11 @@ ctx.drawGraphics.setFont(ctx.font); ctx.drawGraphics.setX(lnBarX); - ctx.drawGraphics.fillRect(ctx.editorUI.lineNumberWidth); + ctx.drawGraphics.fillRect(ctx.lineNumberWidth); ctx.drawGraphics.setX(numX); ctx.drawGraphics.drawChars(0, ctx.lineNumberChars.length, - ctx.lineNumberChars.length * ctx.editorUI.lineNumberDigitWidth); + ctx.lineNumberChars.length * ctx.lineNumberDigitWidth); ctx.drawGraphics.setBuffer(null); // will do changes in buffer @@ -1162,7 +1188,7 @@ } // Initialize the draw-info - initInfo(ctx); + initInfo(ctx, editorUI); // Draw the area drawArea(ctx); @@ -1323,6 +1349,10 @@ /** Coloring for the line-number. */ Coloring lineNumberColoring; + int lineNumberWidth; + int lineNumberDigitWidth; + Insets lineNumberMargin; + /** Graphics object. It can be null when not drawing to the component. */ Graphics graphics; @@ -1361,13 +1391,13 @@ boolean drawMarkUpdate; /** List of draw marks in the painted area. */ - List drawMarkList; + List drawMarkList; /** Current index in the drawMarkList */ int drawMarkIndex; /** Current draw-mark */ - MarkFactory.DrawMark drawMark; + DrawMark drawMark; /** Position of the current draw-mark */ int drawMarkOffset; @@ -1383,6 +1413,7 @@ /** Width of one space character for the current context font. */ int spaceWidth; + int defaultSpaceWidth; /** Display width of the fragment */ int fragmentWidth; @@ -1392,6 +1423,14 @@ */ int fragmentCharCount; + Rectangle extentBounds; + Insets textMargin; + int textLeftMarginWidth; + + boolean textLimitLineVisible; + Color textLimitLineColor; + int textLimitWidth; + public Color getForeColor() { return foreColor; } @@ -1525,4 +1564,5 @@ } } // End of DrawInfo class + } --- a/editor.lib/src/org/netbeans/editor/DrawEngineDocView.java +++ a/editor.lib/src/org/netbeans/editor/DrawEngineDocView.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Graphics; import java.awt.Rectangle; @@ -59,6 +59,8 @@ import org.netbeans.api.editor.fold.FoldUtilities; import org.netbeans.api.editor.fold.FoldHierarchyEvent; import org.netbeans.api.editor.fold.FoldHierarchyListener; +import org.netbeans.editor.BaseTextUI; +import org.netbeans.editor.EditorUI; import org.netbeans.lib.editor.view.GapDocumentView; import org.netbeans.editor.view.spi.LockView; @@ -67,7 +69,7 @@ * * @author Miloslav Metelka */ -/* package */ class DrawEngineDocView extends GapDocumentView +public class DrawEngineDocView extends GapDocumentView implements FoldHierarchyListener, PropertyChangeListener { private static final boolean debugRebuild @@ -86,13 +88,13 @@ private boolean estimatedSpanResetInitiated; - DrawEngineDocView(Element elem) { + public DrawEngineDocView(Element elem) { super(elem); setEstimatedSpan(true); } - public void setParent(View parent) { + public @Override void setParent(View parent) { if (parent != null) { // start listening JTextComponent component = (JTextComponent)parent.getContainer(); foldHierarchy = FoldHierarchy.get(component); @@ -127,7 +129,7 @@ return foldHierarchy; } - protected boolean useCustomReloadChildren() { + protected @Override boolean useCustomReloadChildren() { return true; } @@ -201,7 +203,7 @@ collapsedFold = null; } - protected void customReloadChildren(int index, int removeLength, int startOffset, int endOffset) { + protected @Override void customReloadChildren(int index, int removeLength, int startOffset, int endOffset) { // if removing all the views reset the flag if (index == 0 && removeLength == getViewCount()) { collapsedFoldsInPresentViews = false; // suppose there will be no folds in line views @@ -224,7 +226,7 @@ } } - protected View createCustomView(ViewFactory f, + protected @Override View createCustomView(ViewFactory f, int startOffset, int maxEndOffset, int elementIndex) { if (elementIndex == -1) { throw new IllegalStateException("Need underlying line element structure"); // NOI18N @@ -244,9 +246,9 @@ List foldAndEndLineElemList = new ArrayList(); while (true) { - int collapsedFoldEndOffset = collapsedFold.getEndOffset(); + int _collapsedFoldEndOffset = collapsedFold.getEndOffset(); // Find line element index of the line in which the collapsed fold ends - while (collapsedFoldEndOffset > lineElemEndOffset) { + while (_collapsedFoldEndOffset > lineElemEndOffset) { elementIndex++; lineElem = elem.getElement(elementIndex); lineElemEndOffset = lineElem.getEndOffset(); @@ -322,12 +324,12 @@ } } - public void paint(Graphics g, Shape allocation) { + public @Override void paint(Graphics g, Shape allocation) { java.awt.Component c = getContainer(); if (c instanceof javax.swing.text.JTextComponent){ TextUI textUI = ((javax.swing.text.JTextComponent)c).getUI(); if (textUI instanceof BaseTextUI){ - ((BaseTextUI) textUI).getEditorUI().paint(g); + EditorUiAccessor.get().paint(((BaseTextUI) textUI).getEditorUI(), g); } } @@ -340,7 +342,7 @@ } } - public void setSize(float width, float height) { + public @Override void setSize(float width, float height) { super.setSize(width, height); /* #69446 - disabled estimated span reset @@ -375,7 +377,7 @@ */ } - protected boolean isChildrenResizeDisabled() { + protected @Override boolean isChildrenResizeDisabled() { return true; } --- a/editor.lib/src/org/netbeans/editor/DrawEngineFakeDocView.java +++ a/editor.lib/src/org/netbeans/editor/DrawEngineFakeDocView.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import javax.swing.text.Element; import org.netbeans.api.editor.fold.Fold; @@ -50,7 +50,7 @@ * * @author Martin Roskanin */ -class DrawEngineFakeDocView extends DrawEngineDocView{ +/* package */ class DrawEngineFakeDocView extends DrawEngineDocView{ private boolean useCollapsing = true; private int fakeStartOffset; --- a/editor.lib/src/org/netbeans/editor/DrawEngineLineView.java +++ a/editor.lib/src/org/netbeans/editor/DrawEngineLineView.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Graphics; import java.awt.Rectangle; @@ -55,6 +55,9 @@ import javax.swing.text.Position.Bias; import javax.swing.text.View; import javax.swing.text.ViewFactory; +import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.BaseTextUI; +import org.netbeans.editor.EditorUI; import org.netbeans.editor.view.spi.EstimatedSpanView; import org.netbeans.editor.view.spi.LockView; import org.netbeans.editor.view.spi.ViewLayoutState; @@ -67,7 +70,7 @@ * * @author Martin Roskanin */ -/* package */ class DrawEngineLineView extends View implements ViewLayoutState, EstimatedSpanView { +public class DrawEngineLineView extends View implements ViewLayoutState, EstimatedSpanView { private static final Logger LOG = Logger.getLogger(DrawEngineLineView.class.getName()); private static final boolean loggable = LOG.isLoggable(Level.FINEST); --- a/editor.lib/src/org/netbeans/editor/DrawGraphics.java +++ a/editor.lib/src/org/netbeans/editor/DrawGraphics.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.awt.Graphics; import java.awt.Font; @@ -53,6 +53,12 @@ import java.awt.font.TextLayout; import javax.swing.JComponent; import javax.swing.text.View; +import org.netbeans.editor.Analyzer; +import org.netbeans.editor.AnnotationDesc; +import org.netbeans.editor.AnnotationTypes; +import org.netbeans.editor.Annotations; +import org.netbeans.editor.FontMetricsCache; +import org.netbeans.editor.PrintContainer; /** Draw graphics functions as abstraction over various kinds of drawing. It's used * for drawing into classic graphics, printing and measuring. @@ -63,7 +69,7 @@ * @author Miloslav Metelka * @version 1.00 */ -interface DrawGraphics { +public interface DrawGraphics { /** Set foreground color */ public void setForeColor(Color foreColor); @@ -191,7 +197,7 @@ /** Abstract draw-graphics that maintains a fg and bg color, font, * current x and y coordinates. */ - static abstract class AbstractDG implements DrawGraphics { + public static abstract class AbstractDG implements DrawGraphics { /** Current foreground color */ Color foreColor; @@ -326,7 +332,7 @@ } // End of AbstractDG class - static class SimpleDG extends AbstractDG { + public static class SimpleDG extends AbstractDG { public Graphics getGraphics() { return null; @@ -359,7 +365,7 @@ * It optimizes the drawing by joining together the pieces of * the text drawn with the same font and fg/bg color. */ - static final class GraphicsDG extends SimpleDG { + public static final class GraphicsDG extends SimpleDG { /** Whether debug messages should be displayed */ private static final boolean debug @@ -420,7 +426,7 @@ private JComponent component; - GraphicsDG(Graphics graphics) { + public GraphicsDG(Graphics graphics) { this.graphics = graphics; // #33165 - set invalid y initially this.y = -1; @@ -532,11 +538,12 @@ } public @Override void init(DrawContext ctx) { + EditorUiAccessor accessor = EditorUiAccessor.get(); annos = ctx.getEditorUI().getDocument().getAnnotations(); - drawTextLimitLine = ctx.getEditorUI().textLimitLineVisible; - textLimitWidth = ctx.getEditorUI().textLimitWidth(); - defaultSpaceWidth = ctx.getEditorUI().defaultSpaceWidth; - textLimitLineColor = ctx.getEditorUI().getTextLimitLineColor(); + drawTextLimitLine = accessor.getTextLimitLineVisible(ctx.getEditorUI()); + textLimitWidth = accessor.getTextLimitWidth(ctx.getEditorUI()); + defaultSpaceWidth = accessor.getDefaultSpaceWidth(ctx.getEditorUI()); + textLimitLineColor = accessor.getTextLimitLineColor(ctx.getEditorUI()); absoluteX = ctx.getEditorUI().getTextMargin().left; maxWidth = ctx.getEditorUI().getExtentBounds().width; component = ctx.getEditorUI().getComponent(); @@ -822,7 +829,7 @@ } // End of GraphicsDG class - static final class PrintDG extends SimpleDG { + public static final class PrintDG extends SimpleDG { PrintContainer container; --- a/editor.lib/src/org/netbeans/editor/DrawLayer.java +++ a/editor.lib/src/org/netbeans/editor/DrawLayer.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; /** Draw layer applies changes to draw context during painting process. * Each extended UI has its own set of layers. @@ -61,7 +61,7 @@ */ -public interface DrawLayer { +/* package */ interface DrawLayer { /** * Start of the next region with the frame. @@ -122,7 +122,7 @@ * @param mark draw-mark at the fragment-offset or null if called * because of the next-activity-change-offset. */ - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark); + public boolean isActive(DrawContext ctx, DrawMark mark); /** Update draw context by setting colors, fonts and possibly other draw * properties. @@ -200,7 +200,7 @@ return lineNumber; } - public String toString() { + public @Override String toString() { return "Layer " + getClass() + ", name='" + name; // NOI18N } --- a/editor.lib/src/org/netbeans/editor/DrawLayerList.java +++ a/editor.lib/src/org/netbeans/editor/DrawLayerList.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.util.ArrayList; import java.util.Arrays; @@ -48,6 +48,8 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +import javax.swing.text.JTextComponent; +import org.netbeans.editor.EditorDebug; /** Draw layer list stores multiple draw-layers sorted * according to their visibility which is the integer giving the z-order @@ -59,7 +61,7 @@ */ -class DrawLayerList { +/* package */ class DrawLayerList { private static final Logger LOG = Logger.getLogger(DrawLayerList.class.getName()); @@ -71,6 +73,15 @@ private final ArrayList visibilityList = new ArrayList(); + public static synchronized DrawLayerList forComponent(JTextComponent jtc) { + DrawLayerList dll = (DrawLayerList) jtc.getClientProperty(DrawLayerList.class); + if (dll == null) { + dll = new DrawLayerList(); + jtc.putClientProperty(DrawLayerList.class, dll); + } + return dll; + } + /** Add the new layer to the list depending on visibility. * @param layer layer to add to the layer list * @return true when new layer was added false otherwise. The layer @@ -168,7 +179,7 @@ return -1; } - public String toString() { + public @Override String toString() { switch (layers.length) { case 0: return "No layers"; // NOI18N --- a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/DrawMark.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/DrawMark.java @@ -0,0 +1,121 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.editor.lib.drawing; + +import java.lang.ref.WeakReference; +import javax.swing.text.Position; +import org.netbeans.editor.EditorUI; +import org.netbeans.editor.InvalidMarkException; +import org.netbeans.editor.MarkFactory.ContextMark; + +/** Activation mark for particular layer. When layer is not active +* its updateContext() method is not called. +*/ +/* package */ class DrawMark extends ContextMark { + + /** Activation flag means either activate layer or deactivate it */ + protected boolean activateLayer; + + /** Reference to draw layer this mark belogns to */ + String layerName; + + /** Reference to extended UI if this draw mark is info-specific or + * null if it's document-wide. + */ + WeakReference editorUIRef; + + public DrawMark(String layerName, EditorUI editorUI) { + this(layerName, editorUI, Position.Bias.Forward); + } + + public DrawMark(String layerName, EditorUI editorUI, Position.Bias bias) { + super(bias, false); + this.layerName = layerName; + setEditorUI(editorUI); + } + + public boolean isDocumentMark() { + return (editorUIRef == null); + } + + public EditorUI getEditorUI() { + if (editorUIRef != null) { + return (EditorUI)editorUIRef.get(); + } + return null; + } + + public void setEditorUI(EditorUI editorUI) { + this.editorUIRef = (editorUI != null) ? new WeakReference(editorUI) : null; + } + + public boolean isValidUI() { + return !(editorUIRef != null && editorUIRef.get() == null); + } + + public void setActivateLayer(boolean activateLayer) { + this.activateLayer = activateLayer; + } + + public boolean getActivateLayer() { + return activateLayer; + } + + public boolean removeInvalid() { + if (!isValidUI() && isValid()) { + try { + this.remove(); + } catch (InvalidMarkException e) { + throw new IllegalStateException(e.toString()); + } + return true; // invalid and removed + } + return false; // valid + } + + public @Override String toString() { + try { + return "pos=" + getOffset() + ", line=" + getLine(); // NOI18N + } catch (InvalidMarkException e) { + return "mark not valid"; // NOI18N + } + } + +} --- a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/EditorUiAccessor.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/EditorUiAccessor.java @@ -0,0 +1,97 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.editor.lib.drawing; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Insets; +import java.awt.Rectangle; +import java.util.Map; +import org.netbeans.editor.Coloring; +import org.netbeans.editor.EditorUI; + +/** + * + * @author vita + */ +public abstract class EditorUiAccessor { + + private static EditorUiAccessor ACCESSOR = null; + + public static synchronized void register(EditorUiAccessor accessor) { + assert ACCESSOR == null : "Can't register two package accessors!"; //NOI18N + ACCESSOR = accessor; + } + + public static synchronized EditorUiAccessor get() { + // Trying to wake up EditorUI ... + try { + Class clazz = Class.forName(EditorUI.class.getName()); + } catch (ClassNotFoundException e) { + // ignore + } + + assert ACCESSOR != null : "There is no package accessor available!"; //NOI18N + return ACCESSOR; + } + + protected EditorUiAccessor() { + } + + public abstract boolean isLineNumberVisible(EditorUI eui); + public abstract Coloring getColoring(EditorUI eui, String coloringName); + public abstract int getLineNumberMaxDigitCount(EditorUI eui); + public abstract int getLineNumberWidth(EditorUI eui); + public abstract int getLineNumberDigitWidth(EditorUI eui); + public abstract Insets getLineNumberMargin(EditorUI eui); + public abstract int getLineHeight(EditorUI eui); + public abstract Coloring getDefaultColoring(EditorUI eui); + public abstract int getDefaultSpaceWidth(EditorUI eui); + public abstract Map getRenderingHints(EditorUI eui); + public abstract Rectangle getExtentBounds(EditorUI eui); + public abstract Insets getTextMargin(EditorUI eui); + public abstract int getTextLeftMarginWidth(EditorUI eui); + public abstract boolean getTextLimitLineVisible(EditorUI eui); + public abstract Color getTextLimitLineColor(EditorUI eui); + public abstract int getTextLimitWidth(EditorUI eui); + public abstract int getLineAscent(EditorUI eui); + public abstract void paint(EditorUI eui, Graphics g); + +} --- a/editor.lib/src/org/netbeans/editor/FoldMultiLineView.java +++ a/editor.lib/src/org/netbeans/editor/FoldMultiLineView.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.util.ArrayList; import java.util.List; @@ -50,6 +50,7 @@ import javax.swing.text.View; import javax.swing.text.ViewFactory; import org.netbeans.api.editor.fold.Fold; +import org.netbeans.editor.BaseDocument; import org.netbeans.lib.editor.view.GapMultiLineView; /** @@ -84,11 +85,11 @@ return (JTextComponent)getContainer(); } - protected boolean useCustomReloadChildren() { + protected @Override boolean useCustomReloadChildren() { return true; } - protected void reloadChildren(int index, int removeLength, int startOffset, int endOffset) { + protected @Override void reloadChildren(int index, int removeLength, int startOffset, int endOffset) { // TODO uncomment assert (index == 0 && removeLength == 0 // && startOffset == getStartOffset() && endOffset == getEndOffset()); --- a/editor.lib/src/org/netbeans/editor/HighlightingDrawLayer.java +++ a/editor.lib/src/org/netbeans/editor/HighlightingDrawLayer.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -61,7 +61,11 @@ import javax.swing.text.SimpleAttributeSet; import javax.swing.text.View; import org.netbeans.api.editor.settings.AttributesUtilities; -import org.netbeans.editor.ext.ExtCaret; +import org.netbeans.editor.AtomicLockEvent; +import org.netbeans.editor.AtomicLockListener; +import org.netbeans.editor.BaseCaret; +import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.Coloring; import org.netbeans.editor.view.spi.LockView; import org.netbeans.modules.editor.lib2.highlighting.CaretBasedBlockHighlighting.CaretRowHighlighting; import org.netbeans.modules.editor.lib2.highlighting.HighlightingManager; @@ -80,7 +84,7 @@ * * @author vita */ -/* package */ final class HighlightingDrawLayer extends DrawLayer.AbstractLayer +public final class HighlightingDrawLayer extends DrawLayer.AbstractLayer implements HighlightsChangeListener, AtomicLockListener { // -J-Dorg.netbeans.editor.HighlightingDrawLayer.level=FINE @@ -89,8 +93,7 @@ // Above CaretRowHighlighting.LAYER_TYPE_ID private static final String LAYER_A_NAME = "org-netbeans-lib-editor-nview-HighlightingDrawLayer/A"; //NOI18N // above ZOrder.SYNTAX_RACK and below (including) CaretRowHighlighting.LAYER_TYPE_ID - // Using the original name for the caret row highlighting, some clients use it to remove the layer. - private static final String LAYER_B_NAME = ExtCaret.HIGHLIGHT_ROW_LAYER_NAME; + private static final String LAYER_B_NAME = "org-netbeans-lib-editor-nview-HighlightingDrawLayer/B"; //NOI18N // Only ZOrder.SYNTAX_RACK private static final String LAYER_C_NAME = "org-netbeans-lib-editor-nview-HighlightingDrawLayer/C"; //NOI18N // ZOrder.BOTTOM_RACK @@ -188,60 +191,61 @@ } }; // End of FILTER_D constant - public static void hookUp(EditorUI eui) { - DrawLayer layerA = eui.findLayer(LAYER_A_NAME); + public static void hookUp(JTextComponent jtc) { + DrawLayerList dll = DrawLayerList.forComponent(jtc); + DrawLayer layerA = dll.findLayer(LAYER_A_NAME); if (layerA == null) { layerA = new HighlightingDrawLayer(LAYER_A_NAME, FILTER_A); - eui.addLayer(layerA, 10000); // the old text selection layer's z-order (DrawLayerFactory.CaretLayer) + dll.add(layerA, 10000); // the old text selection layer's z-order (DrawLayerFactory.CaretLayer) if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Successfully registered layerA in " + simpleToString(eui)); //NOI18N + LOG.fine("Successfully registered layerA in " + simpleToString(jtc)); //NOI18N } } else { if (LOG.isLoggable(Level.FINE)) { - LOG.fine("LayerA is already registered in " + simpleToString(eui)); //NOI18N + LOG.fine("LayerA is already registered in " + simpleToString(jtc)); //NOI18N } } - DrawLayer layerB = eui.findLayer(LAYER_B_NAME); + DrawLayer layerB = dll.findLayer(LAYER_B_NAME); if (layerB == null) { layerB = new HighlightingDrawLayer(LAYER_B_NAME, FILTER_B); - eui.addLayer(layerB, 2050); // the old caret row highlight layer's z-order + dll.add(layerB, 2050); // the old caret row highlight layer's z-order if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Successfully registered layerB in " + simpleToString(eui)); //NOI18N + LOG.fine("Successfully registered layerB in " + simpleToString(jtc)); //NOI18N } } else { if (LOG.isLoggable(Level.FINE)) { - LOG.fine("LayerB is already registered in " + simpleToString(eui)); //NOI18N + LOG.fine("LayerB is already registered in " + simpleToString(jtc)); //NOI18N } } - DrawLayer layerC = eui.findLayer(LAYER_C_NAME); + DrawLayer layerC = dll.findLayer(LAYER_C_NAME); if (layerC == null) { layerC = new HighlightingDrawLayer(LAYER_C_NAME, FILTER_C); - eui.addLayer(layerC, 1000); // the old syntax draw layer's z-order (DrawLayerFactory.SyntaxLayer) + dll.add(layerC, 1000); // the old syntax draw layer's z-order (DrawLayerFactory.SyntaxLayer) if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Successfully registered layerC in " + simpleToString(eui)); //NOI18N + LOG.fine("Successfully registered layerC in " + simpleToString(jtc)); //NOI18N } } else { if (LOG.isLoggable(Level.FINE)) { - LOG.fine("LayerC is already registered in " + simpleToString(eui)); //NOI18N + LOG.fine("LayerC is already registered in " + simpleToString(jtc)); //NOI18N } } - DrawLayer layerD = eui.findLayer(LAYER_D_NAME); + DrawLayer layerD = dll.findLayer(LAYER_D_NAME); if (layerD == null) { layerD = new HighlightingDrawLayer(LAYER_D_NAME, FILTER_D); - eui.addLayer(layerD, 500); + dll.add(layerD, 500); if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Successfully registered layerD in " + simpleToString(eui)); //NOI18N + LOG.fine("Successfully registered layerD in " + simpleToString(jtc)); //NOI18N } } else { if (LOG.isLoggable(Level.FINE)) { - LOG.fine("LayerD is already registered in " + simpleToString(eui)); //NOI18N + LOG.fine("LayerD is already registered in " + simpleToString(jtc)); //NOI18N } } } @@ -341,7 +345,7 @@ } } - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { + public boolean isActive(DrawContext ctx, DrawMark mark) { if (highlights != null) { return processOffset(ctx, false); } else { @@ -351,21 +355,22 @@ public void updateContext(DrawContext ctx) { if (highlights != null) { + ColoringAccessor accessor = ColoringAccessor.get(); if (ctx.isEOL() && ctx.isBOL()) { if (extendsEmptyLine() && !theLittleSpitAtTheBeginningOfAnEmptyLineDrawn) { theLittleSpitAtTheBeginningOfAnEmptyLineDrawn = true; Coloring coloring = Coloring.fromAttributeSet(lastELAttribs); - coloring.apply(ctx); + accessor.apply(coloring, ctx); } else { if (extendsEOL()) { Coloring coloring = Coloring.fromAttributeSet(lastEOLAttribs); - coloring.apply(ctx); + accessor.apply(coloring, ctx); } } } else if (ctx.isEOL()) { if (extendsEOL()) { Coloring coloring = Coloring.fromAttributeSet(lastEOLAttribs); - coloring.apply(ctx); + accessor.apply(coloring, ctx); } } else { processOffset(ctx, true); @@ -624,7 +629,7 @@ if (hs.getStartOffset() <= currentOffset) { if (applyAttributes) { Coloring coloring = Coloring.fromAttributeSet(hs.getAttributes()); - coloring.apply(ctx); + ColoringAccessor.get().apply(coloring, ctx); } lastAttributeSet = hs.getAttributes(); @@ -676,7 +681,7 @@ return new AttributeSet [] { eolAttribs, elAttribs }; } - + private static String simpleToString(Object o) { return o == null ? "null" : o.getClass() + "@" + Integer.toHexString(System.identityHashCode(o)); //NOI18N } --- a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/LayerChain.java +++ a/editor.lib/src/org/netbeans/modules/editor/lib/drawing/LayerChain.java @@ -0,0 +1,71 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.editor.lib.drawing; + +import javax.swing.text.Position; +import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.Mark; +import org.netbeans.editor.MarkBlockChain; + +/* package */ class LayerChain extends MarkBlockChain { + + private String layerName; + + public LayerChain(BaseDocument doc, String layerName) { + super(doc); + this.layerName = layerName; + } + + public final String getLayerName() { + return layerName; + } + + protected @Override Mark createBlockStartMark() { + DrawMark startMark = new DrawMark(layerName, null); + startMark.activateLayer = true; + return startMark; + } + + protected @Override Mark createBlockEndMark() { + DrawMark endMark = new DrawMark(layerName, null, Position.Bias.Backward); + return endMark; + } + +} --- a/editor.lib/src/org/netbeans/editor/MarkChain.java +++ a/editor.lib/src/org/netbeans/editor/MarkChain.java @@ -39,10 +39,14 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.drawing; import javax.swing.text.BadLocationException; import javax.swing.text.Position; +import org.netbeans.editor.BaseDocument; +import org.netbeans.editor.InvalidMarkException; +import org.netbeans.editor.Utilities; +import org.netbeans.modules.editor.lib.EditorPackageAccessor; /** * Support class for chain of MarkBlocks @@ -51,13 +55,13 @@ * @version 1.00 */ -public class MarkChain { +public final class MarkChain { /** Chain of all marks */ - protected MarkFactory.ChainDrawMark chain; + protected ChainDrawMark chain; /** Current mark to make checks faster */ - protected MarkFactory.ChainDrawMark curMark; + protected ChainDrawMark curMark; /** Document for this mark */ protected BaseDocument doc; @@ -70,7 +74,7 @@ /** The mark created by addMark() method is stored in this variable. In case * the mark was not created, because there already was some on this position, * the already existing mark is returned. */ - private MarkFactory.ChainDrawMark recentlyAddedMark; + private ChainDrawMark recentlyAddedMark; /** Construct chain using draw marks */ public MarkChain(BaseDocument doc, String layerName) { @@ -78,11 +82,11 @@ this.layerName = layerName; } - public final MarkFactory.ChainDrawMark getChain() { + public final ChainDrawMark getChain() { return chain; } - public final MarkFactory.ChainDrawMark getCurMark() { + public final ChainDrawMark getCurMark() { return curMark; } @@ -133,19 +137,19 @@ } } - protected MarkFactory.ChainDrawMark createAndInsertNewMark(int pos) + protected ChainDrawMark createAndInsertNewMark(int pos) throws BadLocationException { - MarkFactory.ChainDrawMark mark = createMark(); + ChainDrawMark mark = createMark(); try { - mark.insert(doc, pos); + EditorPackageAccessor.get().Mark_insert(mark, doc, pos); } catch (InvalidMarkException e) { Utilities.annotateLoggable(e); } return mark; } - protected MarkFactory.ChainDrawMark createMark() { - MarkFactory.ChainDrawMark mark = new MarkFactory.ChainDrawMark(layerName, null, Position.Bias.Backward); + protected ChainDrawMark createMark() { + ChainDrawMark mark = new ChainDrawMark(layerName, null, Position.Bias.Backward); mark.activateLayer = true; return mark; } @@ -165,7 +169,7 @@ int rel = compareMark(pos); if (rel == 0) { if (forceAdd) { // create fresh - MarkFactory.ChainDrawMark mark = createAndInsertNewMark(pos); + ChainDrawMark mark = createAndInsertNewMark(pos); recentlyAddedMark = mark; if (curMark == chain) { // curMark is first mark chain = curMark.insertChain(mark); @@ -179,7 +183,7 @@ } } else if (rel > 0) { // curMark after pos - MarkFactory.ChainDrawMark mark = createAndInsertNewMark(pos); + ChainDrawMark mark = createAndInsertNewMark(pos); recentlyAddedMark = mark; if (curMark != null) { if (curMark == chain) { // curMark is first mark @@ -191,7 +195,7 @@ chain = mark; } } else { // curMark before pos - MarkFactory.ChainDrawMark mark = createAndInsertNewMark(pos); + ChainDrawMark mark = createAndInsertNewMark(pos); recentlyAddedMark = mark; if (curMark != null) { if (curMark.next != null) { @@ -209,7 +213,7 @@ /** The mark created by addMark() method is returned by this method. In case * the mark was not created, because there already was some on requested position, * the already existing mark is returned. */ - public MarkFactory.ChainDrawMark getAddedMark() { + public ChainDrawMark getAddedMark() { return recentlyAddedMark; } @@ -228,7 +232,7 @@ } } - public boolean removeMark(MarkFactory.ChainDrawMark mark) { + public boolean removeMark(ChainDrawMark mark) { if (mark == null) { throw new NullPointerException(); } --- a/editor.lib/src/org/netbeans/editor/BasePosition.java +++ a/editor.lib/src/org/netbeans/editor/BasePosition.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.impl; import javax.swing.text.BadLocationException; import javax.swing.text.Position; @@ -55,12 +55,12 @@ * @version 1.00 */ -class BasePosition implements Position { +public final class BasePosition implements Position { /** The mark that serves this position */ private MultiMark mark; - BasePosition() throws BadLocationException { + public BasePosition() throws BadLocationException { } /** Get offset in document for this position */ --- a/editor.lib/src/org/netbeans/editor/MarkVector.java +++ a/editor.lib/src/org/netbeans/editor/MarkVector.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.impl; import java.util.List; import javax.swing.text.Position; @@ -53,7 +53,7 @@ * @version 1.00 */ -final class MarkVector { +public final class MarkVector { /** Empty array of marks used initially as markArray. */ private static final MultiMark[] EMPTY = new MultiMark[0]; @@ -83,7 +83,7 @@ */ private int disposedMarkCount; - MarkVector() { + public MarkVector() { markArray = EMPTY; offsetGapLength = INITIAL_OFFSET_GAP_SIZE; } @@ -93,7 +93,7 @@ * @param offset offset of the mark. * @param bias bias of the mark. */ - MultiMark createBiasMark(int offset, Position.Bias bias) { + public MultiMark createBiasMark(int offset, Position.Bias bias) { return new MultiMark(null, this, offset, bias); } @@ -103,7 +103,7 @@ * @param offset offset of the mark. * @param bias bias of the mark. */ - MultiMark createBiasMark(BasePosition pos, int offset, Position.Bias bias) { + public MultiMark createBiasMark(BasePosition pos, int offset, Position.Bias bias) { return new MultiMark(pos, this, offset, bias); } @@ -111,7 +111,7 @@ * inserted into the vector. * @param offset offset of the mark. */ - MultiMark createMark(int offset) { + public MultiMark createMark(int offset) { return new MultiMark(null, this, offset); } @@ -120,21 +120,21 @@ * @param pos position that will delegate to this mark. * @param offset offset of the mark. */ - MultiMark createMark(BasePosition pos, int offset) { + public MultiMark createMark(BasePosition pos, int offset) { return new MultiMark(pos, this, offset); } /** @return total count of marks in the vector. */ - synchronized int getMarkCount() { + public synchronized int getMarkCount() { return markArray.length - gapLength; } - synchronized MultiMark getMark(int index) { + public synchronized MultiMark getMark(int index) { return markArray[getRawIndex(index)]; } - synchronized int getMarkOffsetInternal(int index) { + public synchronized int getMarkOffsetInternal(int index) { return getOffset(getMark(index).rawOffset); } @@ -143,7 +143,7 @@ * @param mark mark to insert. The mark must have the valid * offset and flags filled in. */ - synchronized MultiMark insert(MultiMark mark) { + public synchronized MultiMark insert(MultiMark mark) { int flags = mark.flags; if ((flags & MultiMark.VALID) != 0) { // trying to re-insert valid mark throw new IllegalStateException(); @@ -245,7 +245,7 @@ } } - synchronized void compact() { + public synchronized void compact() { if (gapLength > 0) { int newLength = markArray.length - gapLength; MultiMark[] newMarkArray = new MultiMark[newLength]; @@ -272,7 +272,7 @@ * @return non-null undo record or null in case an insert was done * or there are no marks to be undone. */ - synchronized Undo update(int offset, int length, Undo undo) { + public synchronized Undo update(int offset, int length, Undo undo) { if (length < 0) { // removal occured - temporarily increase offset var offset -= length; // move offset after end of removal (length < 0) } @@ -754,7 +754,7 @@ /** Undo record holding the info about undo items. */ - static final class Undo { + public static final class Undo { Undo(UndoItem firstItem, UndoItem fbItem, UndoItem bbItem, ZeroUndoItem zeroItem) { --- a/editor.lib/src/org/netbeans/editor/MultiMark.java +++ a/editor.lib/src/org/netbeans/editor/MultiMark.java @@ -39,7 +39,7 @@ * made subject to such option by the copyright holder. */ -package org.netbeans.editor; +package org.netbeans.modules.editor.lib.impl; import java.lang.ref.WeakReference; import javax.swing.text.Position; @@ -54,7 +54,7 @@ * @version 1.00 */ -final class MultiMark extends WeakReference implements Runnable { +public final class MultiMark extends WeakReference implements Runnable { /** Whether mark has a backward (or forward) bias */ static final int BACKWARD_BIAS = 1; --- a/editor.lib/test/unit/src/org/netbeans/editor/DrawEngineTest.java +++ a/editor.lib/test/unit/src/org/netbeans/editor/DrawEngineTest.java @@ -39,6 +39,8 @@ import javax.swing.text.Position; import javax.swing.text.View; import org.netbeans.junit.NbTestCase; +import org.netbeans.modules.editor.lib.drawing.DrawEngineDocView; +import org.netbeans.modules.editor.lib.drawing.DrawEngineLineView; /** * --- a/editor.macros/nbproject/project.properties +++ a/editor.macros/nbproject/project.properties @@ -1,3 +1,3 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.7.0 +spec.version.base=1.8.0 --- a/editor.macros/nbproject/project.xml +++ a/editor.macros/nbproject/project.xml @@ -28,7 +28,7 @@ - 1 + 2 --- a/editor.plain.lib/manifest.mf +++ a/editor.plain.lib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.plain.lib/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/editor/plain/Bundle.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 AutoUpdate-Show-In-Client: false --- a/editor.plain.lib/nbproject/project.xml +++ a/editor.plain.lib/nbproject/project.xml @@ -51,8 +51,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.plain/manifest.mf +++ a/editor.plain/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.editor.plain/2 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/plain/Bundle.properties -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 OpenIDE-Module-Layer: org/netbeans/modules/editor/plain/resources/layer.xml AutoUpdate-Show-In-Client: false --- a/editor.plain/nbproject/project.xml +++ a/editor.plain/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor.structure/nbproject/project.properties +++ a/editor.structure/nbproject/project.properties @@ -48,7 +48,7 @@ javac.source=1.5 -spec.version.base=1.22.0 +spec.version.base=1.23.0 javadoc.arch=${basedir}/arch.xml --- a/editor.structure/nbproject/project.xml +++ a/editor.structure/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/editor/nbproject/project.properties +++ a/editor/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.47.0 +spec.version.base=1.48.0 is.autoload=true javadoc.arch=${basedir}/arch.xml --- a/editor/nbproject/project.xml +++ a/editor/nbproject/project.xml @@ -69,7 +69,7 @@ - 1 + 2 --- a/editor/src/org/netbeans/modules/editor/NbEditorDocument.java +++ a/editor/src/org/netbeans/modules/editor/NbEditorDocument.java @@ -117,12 +117,6 @@ } private void init() { - addStyleToLayerMapping(NbDocument.BREAKPOINT_STYLE_NAME, - NbDocument.BREAKPOINT_STYLE_NAME + "Layer:10"); // NOI18N - addStyleToLayerMapping(NbDocument.ERROR_STYLE_NAME, - NbDocument.ERROR_STYLE_NAME + "Layer:20"); // NOI18N - addStyleToLayerMapping(NbDocument.CURRENT_STYLE_NAME, - NbDocument.CURRENT_STYLE_NAME + "Layer:30"); // NOI18N setNormalStyleName(NbDocument.NORMAL_STYLE_NAME); annoMap = new HashMap(20); --- a/form/nbproject/project.properties +++ a/form/nbproject/project.properties @@ -40,7 +40,7 @@ extra.module.files=modules/ext/AbsoluteLayout.jar javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.29.0 +spec.version.base=1.30.0 test-unit-sys-prop.org.netbeans.modules.form.layoutdesign.test=0 jnlp.verify.excludes=sources/org/netbeans/lib/awtextra/AbsoluteLayout.java,sources/org/netbeans/lib/awtextra/AbsoluteConstraints.java,sources/readme.txt --- a/form/nbproject/project.xml +++ a/form/nbproject/project.xml @@ -137,8 +137,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/form/src/org/netbeans/modules/form/FormUtils.java +++ a/form/src/org/netbeans/modules/form/FormUtils.java @@ -59,8 +59,6 @@ import javax.swing.text.Document; import javax.swing.tree.DefaultTreeModel; import org.netbeans.api.editor.DialogBinding; -import org.netbeans.editor.EditorUI; -import org.netbeans.editor.ext.ExtCaret; import org.openide.ErrorManager; import org.openide.util.*; @@ -942,10 +940,10 @@ DialogBinding.bindComponentToDocument(document, ccPosition, 0, editor); // do not highlight current row - EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(editor); - if (eui != null) { // Issue 142686 - eui.removeLayer(ExtCaret.HIGHLIGHT_ROW_LAYER_NAME); - } + editor.putClientProperty( + "HighlightsLayerExcludes", //NOI18N + "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.CaretRowHighlighting$" //NOI18N + ); setupTextUndoRedo(editor); } --- a/gototest/manifest.mf +++ a/gototest/manifest.mf @@ -2,4 +2,4 @@ OpenIDE-Module: org.netbeans.modules.gototest/1 OpenIDE-Module-Layer: org/netbeans/modules/gototest/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gototest/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 --- a/gototest/nbproject/project.xml +++ a/gototest/nbproject/project.xml @@ -51,8 +51,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/groovy.editor/manifest.mf +++ a/groovy.editor/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.groovy.editor/2 OpenIDE-Module-Layer: org/netbeans/modules/groovy/editor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.17 +OpenIDE-Module-Specification-Version: 1.18 --- a/groovy.editor/nbproject/project.xml +++ a/groovy.editor/nbproject/project.xml @@ -99,8 +99,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/groovy.grailsproject/manifest.mf +++ a/groovy.grailsproject/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.groovy.grailsproject OpenIDE-Module-Layer: org/netbeans/modules/groovy/grailsproject/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/grailsproject/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 --- a/groovy.grailsproject/nbproject/project.xml +++ a/groovy.grailsproject/nbproject/project.xml @@ -73,8 +73,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/groovy.gsp/manifest.mf +++ a/groovy.gsp/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.groovy.gsp OpenIDE-Module-Layer: org/netbeans/modules/groovy/gsp/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/gsp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 --- a/groovy.gsp/nbproject/project.xml +++ a/groovy.gsp/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/groovy.refactoring/manifest.mf +++ a/groovy.refactoring/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.groovy.refactoring OpenIDE-Module-Layer: org/netbeans/modules/groovy/refactoring/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/groovy/refactoring/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.10 +OpenIDE-Module-Specification-Version: 1.11 --- a/groovy.refactoring/nbproject/project.xml +++ a/groovy.refactoring/nbproject/project.xml @@ -36,8 +36,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/gsf.api/nbproject/project.properties +++ a/gsf.api/nbproject/project.properties @@ -1,4 +1,4 @@ -spec.version.base=1.14.0 +spec.version.base=1.15.0 is.autoload=true javac.source=1.5 --- a/gsf.api/nbproject/project.xml +++ a/gsf.api/nbproject/project.xml @@ -28,8 +28,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/gsf.codecoverage/manifest.mf +++ a/gsf.codecoverage/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.gsf.codecoverage OpenIDE-Module-Layer: org/netbeans/modules/gsf/codecoverage/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/gsf/codecoverage/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 AutoUpdate-Show-In-Client: false --- a/gsf.codecoverage/nbproject/project.xml +++ a/gsf.codecoverage/nbproject/project.xml @@ -28,8 +28,8 @@ - 1 - 1.29.1 + 2 + 2.1 --- a/gsf/nbproject/project.properties +++ a/gsf/nbproject/project.properties @@ -3,4 +3,4 @@ javac.source=1.5 nbm.needs.restart=true -spec.version.base=0.82.0 +spec.version.base=0.83.0 --- a/gsf/nbproject/project.xml +++ a/gsf/nbproject/project.xml @@ -100,8 +100,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/hibernate/nbproject/project.properties +++ a/hibernate/nbproject/project.properties @@ -41,7 +41,7 @@ hibernate.test.dir=${nb_all}/contrib/hibernate/test -spec.version.base=1.6.0 +spec.version.base=1.7.0 test.unit.cp.extra=\ ${junit.dir}/modules/ext/junit-4.1.jar:\ ${hibernate.test.dir}/unit/data/db-derby-10.2.2.0-bin/lib/derbyclient.jar:\ --- a/hibernate/nbproject/project.xml +++ a/hibernate/nbproject/project.xml @@ -164,8 +164,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/html.editor.lib/manifest.mf +++ a/html.editor.lib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.html.editor.lib/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/html/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.24 +OpenIDE-Module-Specification-Version: 1.25 AutoUpdate-Show-In-Client: false --- a/html.editor.lib/nbproject/project.xml +++ a/html.editor.lib/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/html.editor/manifest.mf +++ a/html.editor/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.html.editor/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/editor/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/html/editor/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.18 +OpenIDE-Module-Specification-Version: 1.19 AutoUpdate-Show-In-Client: false --- a/html.editor/nbproject/project.xml +++ a/html.editor/nbproject/project.xml @@ -113,8 +113,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/html/manifest.mf +++ a/html/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.html/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/html/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/html/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.29 +OpenIDE-Module-Specification-Version: 1.30 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker AutoUpdate-Show-In-Client: false --- a/html/nbproject/project.xml +++ a/html/nbproject/project.xml @@ -87,8 +87,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/j2ee.common/manifest.mf +++ a/j2ee.common/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.j2ee.common/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/common/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.47 +OpenIDE-Module-Specification-Version: 1.48 AutoUpdate-Show-In-Client: false --- a/j2ee.common/nbproject/project.xml +++ a/j2ee.common/nbproject/project.xml @@ -130,8 +130,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/j2ee.ejbcore/manifest.mf +++ a/j2ee.ejbcore/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module-Layer: org/netbeans/modules/j2ee/ejbcore/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbcore/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.15 AutoUpdate-Show-In-Client: false --- a/j2ee.ejbcore/nbproject/project.xml +++ a/j2ee.ejbcore/nbproject/project.xml @@ -162,8 +162,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/j2ee.ejbjarproject/manifest.mf +++ a/j2ee.ejbjarproject/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.j2ee.ejbjarproject OpenIDE-Module-Layer: org/netbeans/modules/j2ee/ejbjarproject/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/ejbjarproject/Bundle.properties -OpenIDE-Module-Specification-Version: 1.20 +OpenIDE-Module-Specification-Version: 1.21 AutoUpdate-Show-In-Client: false --- a/j2ee.ejbjarproject/nbproject/project.xml +++ a/j2ee.ejbjarproject/nbproject/project.xml @@ -137,8 +137,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/j2ee.jpa.refactoring/manifest.mf +++ a/j2ee.jpa.refactoring/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.j2ee.jpa.refactoring OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/j2ee/jpa/refactoring/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 AutoUpdate-Show-In-Client: false --- a/j2ee.jpa.refactoring/nbproject/project.xml +++ a/j2ee.jpa.refactoring/nbproject/project.xml @@ -36,8 +36,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/j2ee.persistence/nbproject/project.properties +++ a/j2ee.persistence/nbproject/project.properties @@ -38,7 +38,7 @@ # made subject to such option by the copyright holder. javac.source=1.5 -spec.version.base=1.12.0 +spec.version.base=1.13.0 test.unit.run.cp.extra=${j2eeserver.dir}/modules/ext/jsr88javax.jar:${j2ee.persistence.dir}/modules/ext/eclipselink/eclipselink-2.0.0.jar:${j2ee.persistence.dir}/modules/ext/eclipselink/eclipselink-javax.persistence-2.0.jar:${masterfs.dir}/modules/org-netbeans-modules-masterfs.jar --- a/j2ee.persistence/nbproject/project.xml +++ a/j2ee.persistence/nbproject/project.xml @@ -153,8 +153,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/java.debug/nbproject/project.properties +++ a/java.debug/nbproject/project.properties @@ -37,4 +37,4 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. javac.source=1.5 -spec.version.base=1.9.0 +spec.version.base=1.10.0 --- a/java.debug/nbproject/project.xml +++ a/java.debug/nbproject/project.xml @@ -43,8 +43,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/java.editor.lib/manifest.mf +++ a/java.editor.lib/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.editor.lib/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/java/editor/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.15 AutoUpdate-Show-In-Client: false --- a/java.editor.lib/nbproject/project.xml +++ a/java.editor.lib/nbproject/project.xml @@ -68,8 +68,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/java.editor.lib/src/org/netbeans/editor/ext/java/JavaDrawLayerFactory.java +++ a/java.editor.lib/src/org/netbeans/editor/ext/java/JavaDrawLayerFactory.java @@ -1,205 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ - -package org.netbeans.editor.ext.java; - -import javax.swing.text.BadLocationException; - -import org.netbeans.editor.*; -import org.netbeans.editor.ext.ExtSyntaxSupport; - -/** - * Various java-layers - * - * @author Miloslav Metelka - * @version 1.00 - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - -public class JavaDrawLayerFactory { - - public static final String JAVA_LAYER_NAME = "java-layer"; // NOI18N - - public static final int JAVA_LAYER_VISIBILITY = 1010; - - /** Layer that colors extra java information like the methods or special - * characters in the character and string literals. - * - * @deprecated Please use Highlighting SPI instead, for details see - * Editor Library 2. - */ - public static class JavaLayer extends DrawLayer.AbstractLayer { - - /** End of the area that is resolved right now. It saves - * repetitive searches for '(' for multiple fragments - * inside one identifier token. - */ - private int resolvedEndOffset; - - private boolean resolvedValue; - - private NonWhitespaceFwdFinder nwFinder = new NonWhitespaceFwdFinder(); - - public JavaLayer() { - super(JAVA_LAYER_NAME); - } - - public void init(DrawContext ctx) { - resolvedEndOffset = 0; // nothing resolved - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - int nextOffset = ctx.getTokenOffset() + ctx.getTokenLength(); - - setNextActivityChangeOffset(nextOffset); - return true; - } - - protected Coloring getMethodColoring(DrawContext ctx) { - TokenContextPath path = ctx.getTokenContextPath().replaceStart( - JavaLayerTokenContext.contextPath); - return ctx.getEditorUI().getColoring( - path.getFullTokenName(JavaLayerTokenContext.METHOD)); - } - - private boolean isMethod(DrawContext ctx) { - int idEndOffset = ctx.getTokenOffset() + ctx.getTokenLength(); - if (idEndOffset > resolvedEndOffset) { // beyond the resolved area - resolvedEndOffset = idEndOffset; // will resolve now - int endOffset = ctx.getEndOffset(); - int bufferStartOffset = ctx.getBufferStartOffset(); - char[] buffer = ctx.getBuffer(); - ExtSyntaxSupport sup = (ExtSyntaxSupport) ctx.getEditorUI().getDocument().getSyntaxSupport().get(ExtSyntaxSupport.class); - int nwOffset = Analyzer.findFirstNonWhite(buffer, - idEndOffset - bufferStartOffset, - endOffset - idEndOffset); - if (nwOffset >= 0) { // found non-white - resolvedValue = (buffer[nwOffset] == '('); - if (!resolvedValue && buffer[nwOffset] == '<') { - try { - int[] block = sup.findMatchingBlock(ctx.getBufferStartOffset() + nwOffset, true); - if (block != null) { - int off = Utilities.getFirstNonWhiteFwd(ctx.getEditorUI().getDocument(), block[1]); - if (off > -1) { - if (bufferStartOffset + buffer.length > off) { - resolvedValue = (buffer[off - bufferStartOffset] == '('); - } else { - resolvedValue = (ctx.getEditorUI().getDocument().getChars(off, 1)[0] == '('); - } - } - } - } catch (BadLocationException e) { - resolvedValue = false; - } - } - } else { // must resolve after buffer end - try { - int off = ctx.getEditorUI().getDocument().find(nwFinder, endOffset, -1); - resolvedValue = off >= 0 && (nwFinder.getFoundChar() == '('); - if (!resolvedValue && nwFinder.getFoundChar() == '<') { - int[] block = sup.findMatchingBlock(off, true); - if (block != null) { - off = Utilities.getFirstNonWhiteFwd(ctx.getEditorUI().getDocument(), block[1]); - if (off > -1) - resolvedValue = (ctx.getEditorUI().getDocument().getChars(off, 1)[0] == '('); - } - } - } catch (BadLocationException e) { - resolvedValue = false; - } - } - } - - return resolvedValue; - } - - public void updateContext(DrawContext ctx) { - if (ctx.getTokenID() == JavaTokenContext.IDENTIFIER && isMethod(ctx)) { - Coloring mc = getMethodColoring(ctx); - if (mc != null) { - mc.apply(ctx); - } - } - } - - } - - /** Find first non-white character forward */ - static class NonWhitespaceFwdFinder extends FinderFactory.GenericFwdFinder { - - private char foundChar; - - public char getFoundChar() { - return foundChar; - } - - protected int scan(char ch, boolean lastChar) { - if (!Character.isWhitespace(ch)) { - found = true; - foundChar = ch; - return 0; - } - return 1; - } - } - - /** Find first non-white character backward */ - public static class NonWhitespaceBwdFinder extends FinderFactory.GenericBwdFinder { - - private char foundChar; - - public char getFoundChar() { - return foundChar; - } - - protected int scan(char ch, boolean lastChar) { - if (!Character.isWhitespace(ch)) { - found = true; - foundChar = ch; - return 0; - } - return -1; - } - } - -} - --- a/java.editor/nbproject/project.properties +++ a/java.editor/nbproject/project.properties @@ -39,7 +39,7 @@ javadoc.title=Java Editor -spec.version.base=2.22.0 +spec.version.base=2.23.0 test.qa-functional.cp.extra=${editor.dir}/modules/org-netbeans-modules-editor-fold.jar javac.source=1.5 #test.unit.cp.extra= --- a/java.editor/nbproject/project.xml +++ a/java.editor/nbproject/project.xml @@ -145,8 +145,8 @@ - 1 - 1.32 + 2 + 2.1 --- a/java.hints/nbproject/project.properties +++ a/java.hints/nbproject/project.properties @@ -37,7 +37,7 @@ # Version 2 license, then the option applies only if the new code is # made subject to such option by the copyright holder. -spec.version.base=1.32.0 +spec.version.base=1.33.0 javac.source=1.5 --- a/java.hints/nbproject/project.xml +++ a/java.hints/nbproject/project.xml @@ -111,8 +111,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/java.navigation/manifest.mf +++ a/java.navigation/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.java.navigation/1 OpenIDE-Module-Layer: org/netbeans/modules/java/navigation/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/navigation/Bundle.properties -OpenIDE-Module-Specification-Version: 1.14 +OpenIDE-Module-Specification-Version: 1.15 AutoUpdate-Show-In-Client: false --- a/java.navigation/nbproject/project.xml +++ a/java.navigation/nbproject/project.xml @@ -95,8 +95,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/java.source/nbproject/project.properties +++ a/java.source/nbproject/project.properties @@ -43,7 +43,7 @@ javadoc.title=Java Source javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=0.53.0 +spec.version.base=0.54.0 test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\ ${o.n.core.dir}/lib/boot.jar:\ --- a/java.source/nbproject/project.xml +++ a/java.source/nbproject/project.xml @@ -145,8 +145,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/javascript.editing/manifest.mf +++ a/javascript.editing/manifest.mf @@ -3,6 +3,6 @@ OpenIDE-Module-Install: org/netbeans/modules/javascript/editing/Installer.class OpenIDE-Module-Layer: org/netbeans/modules/javascript/editing/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/editing/Bundle.properties -OpenIDE-Module-Specification-Version: 0.92 +OpenIDE-Module-Specification-Version: 0.93 AutoUpdate-Show-In-Client: false --- a/javascript.editing/nbproject/project.xml +++ a/javascript.editing/nbproject/project.xml @@ -91,8 +91,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/javascript.hints/manifest.mf +++ a/javascript.hints/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.javascript.hints/1 -OpenIDE-Module-Specification-Version: 0.42 +OpenIDE-Module-Specification-Version: 0.43 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/javascript/hints/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/javascript/hints/layer.xml AutoUpdate-Show-In-Client: false --- a/javascript.hints/nbproject/project.xml +++ a/javascript.hints/nbproject/project.xml @@ -46,8 +46,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/javascript.refactoring/manifest.mf +++ a/javascript.refactoring/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module-Layer: org/netbeans/modules/refactoring/javascript/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/javascript/resources/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 0.67 +OpenIDE-Module-Specification-Version: 0.68 --- a/javascript.refactoring/nbproject/project.xml +++ a/javascript.refactoring/nbproject/project.xml @@ -46,8 +46,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/jellytools.ide/nbproject/project.properties +++ a/jellytools.ide/nbproject/project.properties @@ -2,6 +2,6 @@ javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial javadoc.arch=${basedir}/arch.xml -spec.version.base=3.3.0 +spec.version.base=3.4.0 test.config.bundle.includes=**/IDEBundleKeysTest.class --- a/jellytools.ide/nbproject/project.xml +++ a/jellytools.ide/nbproject/project.xml @@ -36,8 +36,8 @@ - 1 - 1.34 + 2 + 2.1 --- a/jumpto/manifest.mf +++ a/jumpto/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.jumpto/1 OpenIDE-Module-Layer: org/netbeans/modules/jumpto/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jumpto/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.13 +OpenIDE-Module-Specification-Version: 1.14 AutoUpdate-Show-In-Client: false --- a/jumpto/nbproject/project.xml +++ a/jumpto/nbproject/project.xml @@ -70,8 +70,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/languages.refactoring/nbproject/project.properties +++ a/languages.refactoring/nbproject/project.properties @@ -2,4 +2,4 @@ is.eager=true javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.1.0 +spec.version.base=1.2.0 --- a/languages.refactoring/nbproject/project.xml +++ a/languages.refactoring/nbproject/project.xml @@ -70,8 +70,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/languages.yaml/manifest.mf +++ a/languages.yaml/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.languages.yaml OpenIDE-Module-Layer: org/netbeans/modules/languages/yaml/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/languages/yaml/Bundle.properties -OpenIDE-Module-Specification-Version: 2.6 +OpenIDE-Module-Specification-Version: 2.7 AutoUpdate-Show-In-Client: false --- a/languages.yaml/nbproject/project.xml +++ a/languages.yaml/nbproject/project.xml @@ -28,8 +28,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/languages/nbproject/project.properties +++ a/languages/nbproject/project.properties @@ -3,4 +3,4 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.97.0 +spec.version.base=1.98.0 --- a/languages/nbproject/project.xml +++ a/languages/nbproject/project.xml @@ -70,8 +70,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/maven.grammar/manifest.mf +++ a/maven.grammar/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.grammar/1 -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/grammar/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/maven/grammar/layer.xml OpenIDE-Module-Public-Packages: - --- a/maven.grammar/nbproject/project.xml +++ a/maven.grammar/nbproject/project.xml @@ -69,8 +69,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/maven.hints/manifest.mf +++ a/maven.hints/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.hints/1 -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/hints/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/maven/hints/layer.xml AutoUpdate-Show-In-Client: false --- a/maven.hints/nbproject/project.xml +++ a/maven.hints/nbproject/project.xml @@ -86,8 +86,8 @@ - 1 - 1.30 + 2 + 2.1 --- a/maven.model/manifest.mf +++ a/maven.model/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.maven.model/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/maven/model/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 --- a/maven.model/nbproject/project.xml +++ a/maven.model/nbproject/project.xml @@ -10,8 +10,8 @@ - 1 - 1.29 + 2 + 2.1 --- a/mercurial/nbproject/project.properties +++ a/mercurial/nbproject/project.properties @@ -5,7 +5,7 @@ nbm.homepage=http://wiki.netbeans.org/wiki/view/MercurialVersionControl nbm.module.author=John Rice and Padraig O'Briain nbm.needs.restart=true -spec.version.base=1.12.0 +spec.version.base=1.13.0 #qa-functional test.qa-functional.cp.extra=${openide.nodes.dir}/modules/org-openide-nodes.jar:\${openide.util.dir}/lib/org-openide-util.jar --- a/mercurial/nbproject/project.xml +++ a/mercurial/nbproject/project.xml @@ -63,8 +63,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/mobility.editor/manifest.mf +++ a/mobility.editor/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.mobility.editor -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 OpenIDE-Module-Layer: org/netbeans/modules/mobility/editor/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mobility/editor/Bundle.properties AutoUpdate-Show-In-Client: false --- a/mobility.editor/nbproject/project.xml +++ a/mobility.editor/nbproject/project.xml @@ -102,8 +102,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/mobility.project.bridge.impl/manifest.mf +++ a/mobility.project.bridge.impl/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.mobility.project.bridge.impl OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mobility/project/bridge/impl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 AutoUpdate-Show-In-Client: false --- a/mobility.project.bridge.impl/nbproject/project.xml +++ a/mobility.project.bridge.impl/nbproject/project.xml @@ -45,8 +45,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/mobility.svgcore/manifest.mf +++ a/mobility.svgcore/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.mobility.svgcore OpenIDE-Module-Layer: org/netbeans/modules/mobility/svgcore/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mobility/svgcore/Bundle.properties -OpenIDE-Module-Specification-Version: 1.8 +OpenIDE-Module-Specification-Version: 1.9 AutoUpdate-Show-In-Client: false --- a/mobility.svgcore/nbproject/project.xml +++ a/mobility.svgcore/nbproject/project.xml @@ -64,8 +64,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/nbbuild/cluster.properties +++ a/nbbuild/cluster.properties @@ -304,7 +304,6 @@ editor.errorstripe.api,\ editor.fold,\ editor.guards,\ - editor.highlights,\ editor.indent,\ editor.kit,\ editor.lib,\ @@ -350,7 +349,6 @@ languages.manifest,\ languages.yaml,\ lexer,\ - lexer.editorbridge,\ lexer.nbbridge,\ lib.cvsclient,\ libs.bugtracking,\ @@ -1242,7 +1240,6 @@ contrib/glassfish.v3enable,\ contrib/graphicclassview,\ contrib/group,\ - contrib/gsf.tools,\ contrib/hexeditor,\ contrib/htmlprojects,\ contrib/hudsonfindbugs,\ --- a/openide.text/apichanges.xml +++ a/openide.text/apichanges.xml @@ -46,6 +46,24 @@ Text API + + +

Deprecating style constants in NbDocument + + + + + +

+ Deprecating BREAKPOINT_STYLE_NAME, ERROR_STYLE_NAME, + CURRENT_STYLE_NAME, NORMAL_STYLE_NAME in NbDocument class. + Document styles have been abandoned when Annotations API was created. + These constants are no longer functional. +

+
+ + +
Add CloneableEditorSupport.asynchronousOpen --- a/openide.text/manifest.mf +++ a/openide.text/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.text OpenIDE-Module-Install: org/netbeans/modules/openide/text/Installer.class -OpenIDE-Module-Specification-Version: 6.28 +OpenIDE-Module-Specification-Version: 6.29 OpenIDE-Module-Localizing-Bundle: org/openide/text/Bundle.properties AutoUpdate-Essential-Module: true --- a/openide.text/src/org/openide/text/NbDocument.java +++ a/openide.text/src/org/openide/text/NbDocument.java @@ -78,22 +78,30 @@ /** Name of style attached to documents to mark a paragraph (line) * as a (debugger) breakpoint. + * @deprecated since 6.29. Use {@link Annotation} instead. */ + @Deprecated public static final String BREAKPOINT_STYLE_NAME = "NbBreakpointStyle"; // NOI18N /** Name of style attached to documents to mark a paragraph (line) * as erroneous. + * @deprecated since 6.29. Use {@link Annotation} instead. */ + @Deprecated public static final String ERROR_STYLE_NAME = "NbErrorStyle"; // NOI18N /** Name of style attached to documents to mark a paragraph (line) * as current (in a debugger). + * @deprecated since 6.29. Use {@link Annotation} instead. */ + @Deprecated public static final String CURRENT_STYLE_NAME = "NbCurrentStyle"; // NOI18N /** Name of style attached to documents to unmark a paragraph (line) * as anything special. + * @deprecated since 6.29. Use {@link Annotation} instead. */ + @Deprecated public static final String NORMAL_STYLE_NAME = "NbNormalStyle"; // NOI18N private NbDocument() { --- a/options.editor/manifest.mf +++ a/options.editor/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.options.editor/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/editor/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/options/editor/mf-layer.xml -OpenIDE-Module-Specification-Version: 1.16 +OpenIDE-Module-Specification-Version: 1.17 AutoUpdate-Show-In-Client: false --- a/options.editor/nbproject/project.xml +++ a/options.editor/nbproject/project.xml @@ -78,8 +78,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/parsing.api/nbproject/project.properties +++ a/parsing.api/nbproject/project.properties @@ -2,4 +2,4 @@ javac.source=1.5 javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=1.27.0 +spec.version.base=1.28.0 --- a/parsing.api/nbproject/project.xml +++ a/parsing.api/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.38 + 2 + 2.1 --- a/php.editor/nbproject/project.properties +++ a/php.editor/nbproject/project.properties @@ -1,7 +1,7 @@ javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial nbm.needs.restart=true -spec.version.base=1.9.0 +spec.version.base=1.10.0 test-unit-sys-prop.xtest.js.home=${netbeans.dest.dir}/gsf1 release.external/phpdocdesc.zip=docs/phpdocdesc.zip release.external/predefined_vars.zip=docs/predefined_vars.zip --- a/php.editor/nbproject/project.xml +++ a/php.editor/nbproject/project.xml @@ -126,8 +126,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/php.project/manifest.mf +++ a/php.project/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 2.22 +OpenIDE-Module-Specification-Version: 2.23 OpenIDE-Module: org.netbeans.modules.php.project OpenIDE-Module-Layer: org/netbeans/modules/php/project/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/project/resources/Bundle.properties --- a/php.project/nbproject/project.xml +++ a/php.project/nbproject/project.xml @@ -114,8 +114,8 @@ - 1 - 1.40 + 2 + 2.1 --- a/php.refactoring/manifest.mf +++ a/php.refactoring/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.php.refactoring OpenIDE-Module-Layer: org/netbeans/modules/refactoring/php/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/php/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 --- a/php.refactoring/nbproject/project.xml +++ a/php.refactoring/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/print.editor/manifest.mf +++ a/print.editor/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 7.4 +OpenIDE-Module-Specification-Version: 7.5 OpenIDE-Module: org.netbeans.modules.print.editor OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/print/editor/resources/Bundle.properties --- a/print.editor/nbproject/project.xml +++ a/print.editor/nbproject/project.xml @@ -58,8 +58,8 @@ - 1 - 1.28 + 2 + 2.1 --- a/profiler.oql.language/manifest.mf +++ a/profiler.oql.language/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.profiler.oql.language/0 OpenIDE-Module-Layer: org/netbeans/modules/profiler/oql/language/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/oql/language/Bundle.properties -OpenIDE-Module-Specification-Version: 0.5 +OpenIDE-Module-Specification-Version: 0.6 --- a/profiler.oql.language/nbproject/project.xml +++ a/profiler.oql.language/nbproject/project.xml @@ -46,8 +46,8 @@ - 1 - 1.30 + 2 + 2.1 --- a/profiler.projectsupport/manifest.mf +++ a/profiler.projectsupport/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.projectsupport OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/projectsupport/Bundle.properties -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 --- a/profiler.projectsupport/nbproject/project.xml +++ a/profiler.projectsupport/nbproject/project.xml @@ -54,8 +54,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/profiler.utilities/manifest.mf +++ a/profiler.utilities/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.profiler.utilities/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/utilities/Bundle.properties -OpenIDE-Module-Specification-Version: 1.11 +OpenIDE-Module-Specification-Version: 1.12 --- a/profiler.utilities/nbproject/project.xml +++ a/profiler.utilities/nbproject/project.xml @@ -63,8 +63,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/profiler/manifest.mf +++ a/profiler/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module-Layer: org/netbeans/modules/profiler/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/profiler/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/profiler/ProfilerModule.class -OpenIDE-Module-Specification-Version: 1.15 +OpenIDE-Module-Specification-Version: 1.16 OpenIDE-Module-Provides: org.netbeans.modules.profiler --- a/profiler/nbproject/project.xml +++ a/profiler/nbproject/project.xml @@ -140,8 +140,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/properties.syntax/manifest.mf +++ a/properties.syntax/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.properties.syntax/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/properties/syntax/Bundle.properties -OpenIDE-Module-Specification-Version: 1.25 +OpenIDE-Module-Specification-Version: 1.26 OpenIDE-Module-Install: org/netbeans/modules/properties/syntax/RestoreColoring.class OpenIDE-Module-Layer: org/netbeans/modules/properties/syntax/Layer.xml --- a/properties.syntax/nbproject/project.xml +++ a/properties.syntax/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/python.debugger/manifest.mf +++ a/python.debugger/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.python.debugger OpenIDE-Module-Layer: org/netbeans/modules/python/debugger/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/python/debugger/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 +OpenIDE-Module-Specification-Version: 1.1 AutoUpdate-Show-In-Client: false --- a/python.debugger/nbproject/project.xml +++ a/python.debugger/nbproject/project.xml @@ -28,8 +28,8 @@ - 1 - 1.28.0.8.2 + 2 + 2.1 --- a/python.debugger/src/org/netbeans/modules/python/debugger/gui/WatchPanel.java +++ a/python.debugger/src/org/netbeans/modules/python/debugger/gui/WatchPanel.java @@ -72,10 +72,8 @@ import java.awt.Insets; import java.awt.event.ActionListener; import java.io.IOException; -import javax.naming.event.EventDirContext; import javax.swing.text.StyledDocument; import org.netbeans.editor.EditorUI; -import org.netbeans.editor.ext.ExtCaret; import org.openide.ErrorManager; import org.openide.cookies.EditorCookie; import org.openide.text.NbDocument; @@ -180,7 +178,13 @@ final Runnable runnable = new Runnable() { public void run() { EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(editorPane); - eui.removeLayer(ExtCaret.HIGHLIGHT_ROW_LAYER_NAME); + if (eui == null) { + return ; + } + editorPane.putClientProperty( + "HighlightsLayerExcludes", //NOI18N + "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.CaretRowHighlighting$" //NOI18N + ); // Do not draw text limit line try { java.lang.reflect.Field textLimitLineField = EditorUI.class.getDeclaredField("textLimitLineVisible"); // NOI18N --- a/python.editor/nbproject/project.properties +++ a/python.editor/nbproject/project.properties @@ -18,7 +18,7 @@ javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial nbm.needs.restart=true -spec.version.base=1.3.0 +spec.version.base=1.4.0 spec.version.base.fatal.warning=false ant.jar=${ant.core.lib} --- a/python.editor/nbproject/project.xml +++ a/python.editor/nbproject/project.xml @@ -55,8 +55,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/python.testrunner/manifest.mf +++ a/python.testrunner/manifest.mf @@ -2,5 +2,5 @@ AutoUpdate-Show-In-Client: false OpenIDE-Module: org.netbeans.modules.python.testrunner OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/python/testrunner/Bundle.properties -OpenIDE-Module-Specification-Version: 1.2 +OpenIDE-Module-Specification-Version: 1.3 --- a/python.testrunner/nbproject/project.xml +++ a/python.testrunner/nbproject/project.xml @@ -26,8 +26,8 @@ - 1 - 1.30 + 2 + 2.1 --- a/refactoring.api/manifest.mf +++ a/refactoring.api/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.refactoring.api OpenIDE-Module-Layer: org/netbeans/modules/refactoring/api/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/api/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.9 +OpenIDE-Module-Specification-Version: 1.10 AutoUpdate-Show-In-Client: false --- a/refactoring.api/nbproject/project.xml +++ a/refactoring.api/nbproject/project.xml @@ -54,8 +54,8 @@ - 1 - 1.30 + 2 + 2.1 --- a/ruby.extrahints/manifest.mf +++ a/ruby.extrahints/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module: org.netbeans.modules.ruby.extrahints/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/extrahints/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/ruby/extrahints/layer.xml -OpenIDE-Module-Specification-Version: 0.46 +OpenIDE-Module-Specification-Version: 0.47 --- a/ruby.extrahints/nbproject/project.xml +++ a/ruby.extrahints/nbproject/project.xml @@ -46,8 +46,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.hints/manifest.mf +++ a/ruby.hints/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.ruby.hints/1 -OpenIDE-Module-Specification-Version: 0.43 +OpenIDE-Module-Specification-Version: 0.44 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/hints/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/ruby/hints/layer.xml AutoUpdate-Show-In-Client: false --- a/ruby.hints/nbproject/project.xml +++ a/ruby.hints/nbproject/project.xml @@ -64,8 +64,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.project/manifest.mf +++ a/ruby.project/manifest.mf @@ -4,5 +4,5 @@ OpenIDE-Module-Install: org/netbeans/modules/ruby/rubyproject/RubyProjectModuleInstaller.class OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/rubyproject/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.12 +OpenIDE-Module-Specification-Version: 1.13 AutoUpdate-Show-In-Client: false --- a/ruby.project/nbproject/project.xml +++ a/ruby.project/nbproject/project.xml @@ -64,8 +64,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.railsprojects/manifest.mf +++ a/ruby.railsprojects/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module-Layer: org/netbeans/modules/ruby/railsprojects/ui/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/railsprojects/Bundle.properties OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 AutoUpdate-Show-In-Client: false --- a/ruby.railsprojects/nbproject/project.xml +++ a/ruby.railsprojects/nbproject/project.xml @@ -72,8 +72,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.refactoring/manifest.mf +++ a/ruby.refactoring/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module-Layer: org/netbeans/modules/refactoring/ruby/resources/mf-layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/ruby/resources/Bundle.properties AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 0.67 +OpenIDE-Module-Specification-Version: 0.68 --- a/ruby.refactoring/nbproject/project.xml +++ a/ruby.refactoring/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.rhtml/nbproject/project.properties +++ a/ruby.rhtml/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=0.70.0 +spec.version.base=0.71.0 test-unit-sys-prop.xtest.jruby.home=${netbeans.dest.dir}/ruby2/jruby-1.2.0 --- a/ruby.rhtml/nbproject/project.xml +++ a/ruby.rhtml/nbproject/project.xml @@ -73,8 +73,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby.rspec/manifest.mf +++ a/ruby.rspec/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.ruby.rspec/1 OpenIDE-Module-Layer: org/netbeans/modules/ruby/rspec/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/rspec/Bundle.properties -OpenIDE-Module-Specification-Version: 0.86.0 +OpenIDE-Module-Specification-Version: 0.87 AutoUpdate-Show-In-Client: true --- a/ruby.rspec/nbproject/project.xml +++ a/ruby.rspec/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/ruby/manifest.mf +++ a/ruby/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.ruby/1 OpenIDE-Module-Layer: org/netbeans/modules/ruby/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ruby/Bundle.properties -OpenIDE-Module-Specification-Version: 1.15 +OpenIDE-Module-Specification-Version: 1.16 AutoUpdate-Show-In-Client: false --- a/ruby/nbproject/project.xml +++ a/ruby/nbproject/project.xml @@ -91,8 +91,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/spi.debugger.ui/manifest.mf +++ a/spi.debugger.ui/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.spi.debugger.ui/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml -OpenIDE-Module-Specification-Version: 2.20 +OpenIDE-Module-Specification-Version: 2.21 OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class --- a/spi.debugger.ui/nbproject/project.xml +++ a/spi.debugger.ui/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.33 + 2 + 2.1 --- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/WatchPanel.java +++ a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/WatchPanel.java @@ -57,7 +57,6 @@ import javax.swing.text.StyledDocument; import org.netbeans.api.editor.DialogBinding; import org.netbeans.editor.EditorUI; -import org.netbeans.editor.ext.ExtCaret; import org.netbeans.spi.debugger.ui.EditorContextDispatcher; import org.openide.ErrorManager; import org.openide.cookies.EditorCookie; @@ -133,9 +132,13 @@ Runnable runnable = new Runnable() { public void run() { EditorUI eui = org.netbeans.editor.Utilities.getEditorUI(editorPane); - if (eui != null) { - eui.removeLayer(ExtCaret.HIGHLIGHT_ROW_LAYER_NAME); + if (eui == null) { + return; } + editorPane.putClientProperty( + "HighlightsLayerExcludes", //NOI18N + "^org\\.netbeans\\.modules\\.editor\\.lib2\\.highlighting\\.CaretRowHighlighting$" //NOI18N + ); // Do not draw text limit line try { java.lang.reflect.Field textLimitLineField = EditorUI.class.getDeclaredField("textLimitLineVisible"); // NOI18N --- a/spi.editor.hints/nbproject/project.properties +++ a/spi.editor.hints/nbproject/project.properties @@ -39,4 +39,4 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.11.0 +spec.version.base=1.12.0 --- a/spi.editor.hints/nbproject/project.xml +++ a/spi.editor.hints/nbproject/project.xml @@ -77,8 +77,8 @@ - 1 - 1.32 + 2 + 2.1 --- a/spring.beans/nbproject/project.properties +++ a/spring.beans/nbproject/project.properties @@ -40,4 +40,4 @@ javac.source=1.5 javac.compilerargs=-Xlint -Xlint:-serial -spec.version.base=1.10.0 +spec.version.base=1.11.0 --- a/spring.beans/nbproject/project.xml +++ a/spring.beans/nbproject/project.xml @@ -119,8 +119,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/subversion/nbproject/project.properties +++ a/subversion/nbproject/project.properties @@ -1,4 +1,4 @@ -spec.version.base=1.9.0 +spec.version.base=1.10.0 javac.compilerargs=-Xlint:unchecked javac.source=1.5 --- a/subversion/nbproject/project.xml +++ a/subversion/nbproject/project.xml @@ -80,8 +80,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/versioning.system.cvss/nbproject/project.properties +++ a/versioning.system.cvss/nbproject/project.properties @@ -40,7 +40,7 @@ javac.source=1.5 javadoc.name=CVS Versioning System javadoc.arch=${basedir}/arch.xml -spec.version.base=1.16.0 +spec.version.base=1.17.0 test-unit-sys-prop.test.junit.jar=${junit.dir}/modules/ext/junit-3.8.1.jar test-unit-sys-prop.work.root.dir=${basedir}/build/test/unit/work --- a/versioning.system.cvss/nbproject/project.xml +++ a/versioning.system.cvss/nbproject/project.xml @@ -121,8 +121,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/versioning.util/nbproject/project.properties +++ a/versioning.util/nbproject/project.properties @@ -41,7 +41,7 @@ javac.source=1.5 javadoc.name=Versioning Support Utilities -spec.version.base=1.9.1 +spec.version.base=1.10.0 is.autoload=true # Fatal error: Fatal error: class javax.net.SocketFactory not found --- a/versioning.util/nbproject/project.xml +++ a/versioning.util/nbproject/project.xml @@ -72,8 +72,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/versioning/nbproject/project.properties +++ a/versioning/nbproject/project.properties @@ -41,7 +41,7 @@ javac.source=1.5 javadoc.name=Versioning -spec.version.base=1.14.0 +spec.version.base=1.15.0 is.autoload=true javadoc.arch=${basedir}/arch.xml --- a/versioning/nbproject/project.xml +++ a/versioning/nbproject/project.xml @@ -86,8 +86,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/visualweb.designer.jsf/manifest.mf +++ a/visualweb.designer.jsf/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.visualweb.designer.jsf OpenIDE-Module-Layer: org/netbeans/modules/visualweb/designer/jsf/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visualweb/designer/jsf/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 2.6 +OpenIDE-Module-Specification-Version: 2.7 AutoUpdate-Show-In-Client: false --- a/visualweb.designer.jsf/nbproject/project.xml +++ a/visualweb.designer.jsf/nbproject/project.xml @@ -87,8 +87,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/visualweb.gravy/manifest.mf +++ a/visualweb.gravy/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.visualweb.gravy OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visualweb/gravy/Bundle.properties -OpenIDE-Module-Specification-Version: 1.4 +OpenIDE-Module-Specification-Version: 1.5 AutoUpdate-Show-In-Client: false --- a/visualweb.gravy/nbproject/project.xml +++ a/visualweb.gravy/nbproject/project.xml @@ -86,8 +86,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/visualweb.insync/manifest.mf +++ a/visualweb.insync/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 2.7 +OpenIDE-Module-Specification-Version: 2.8 OpenIDE-Module: org.netbeans.modules.visualweb.insync/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visualweb/insync/Bundle.properties OpenIDE-Module-Install: org/netbeans/modules/visualweb/insync/ModuleInstaller.class --- a/visualweb.insync/nbproject/project.xml +++ a/visualweb.insync/nbproject/project.xml @@ -112,8 +112,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/visualweb.palette/manifest.mf +++ a/visualweb.palette/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.visualweb.palette OpenIDE-Module-Layer: org/netbeans/modules/visualweb/palette/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visualweb/palette/Bundle.properties -OpenIDE-Module-Specification-Version: 2.6 +OpenIDE-Module-Specification-Version: 2.7 AutoUpdate-Show-In-Client: false --- a/visualweb.palette/nbproject/project.xml +++ a/visualweb.palette/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/visualweb.project.jsfloader/manifest.mf +++ a/visualweb.project.jsfloader/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.visualweb.project.jsfloader/1 -OpenIDE-Module-Specification-Version: 2.6 +OpenIDE-Module-Specification-Version: 2.7 OpenIDE-Module-Layer: org/netbeans/modules/visualweb/project/jsfloader/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/visualweb/project/jsfloader/Bundle.properties AutoUpdate-Show-In-Client: false --- a/visualweb.project.jsfloader/nbproject/project.xml +++ a/visualweb.project.jsfloader/nbproject/project.xml @@ -60,8 +60,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/vmd.midp/manifest.mf +++ a/vmd.midp/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.vmd.midp OpenIDE-Module-Layer: org/netbeans/modules/vmd/midp/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/vmd/midp/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker AutoUpdate-Show-In-Client: false --- a/vmd.midp/nbproject/project.xml +++ a/vmd.midp/nbproject/project.xml @@ -111,8 +111,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/wag.codegen/manifest.mf +++ a/wag.codegen/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.wag.codegen OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/wag/codegen/Bundle.properties -OpenIDE-Module-Specification-Version: 0.7 +OpenIDE-Module-Specification-Version: 0.8 AutoUpdate-Show-In-Client: false --- a/wag.codegen/nbproject/project.xml +++ a/wag.codegen/nbproject/project.xml @@ -55,8 +55,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/wag.manager/manifest.mf +++ a/wag.manager/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.wag.manager OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/wag/manager/Bundle.properties -OpenIDE-Module-Specification-Version: 0.7 +OpenIDE-Module-Specification-Version: 0.8 OpenIDE-Module-Install: org/netbeans/modules/wag/manager/WagModuleInstaller.class AutoUpdate-Show-In-Client: false --- a/wag.manager/nbproject/project.xml +++ a/wag.manager/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.41 + 2 + 2.1 --- a/web.beans/manifest.mf +++ a/web.beans/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.web.beans/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/beans/resources/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/beans/resources/layer.xml -OpenIDE-Module-Specification-Version: 1.2 +OpenIDE-Module-Specification-Version: 1.3 AutoUpdate-Show-In-Client: false --- a/web.beans/nbproject/project.xml +++ a/web.beans/nbproject/project.xml @@ -45,8 +45,8 @@ - 1 - 1.40 + 2 + 2.1 --- a/web.client.tools.impl/manifest.mf +++ a/web.client.tools.impl/manifest.mf @@ -3,5 +3,5 @@ OpenIDE-Module: org.netbeans.modules.web.client.tools.impl OpenIDE-Module-Layer: org/netbeans/modules/web/client/tools/impl/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/client/tools/impl/Bundle.properties -OpenIDE-Module-Specification-Version: 1.2 +OpenIDE-Module-Specification-Version: 1.3 --- a/web.client.tools.impl/nbproject/project.xml +++ a/web.client.tools.impl/nbproject/project.xml @@ -37,8 +37,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.core.syntax/nbproject/project.properties +++ a/web.core.syntax/nbproject/project.properties @@ -47,7 +47,7 @@ javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=2.8.0 +spec.version.base=2.9.0 test.config.validation.includes=\ **/AutoCompletionTest.class,**/CompletionTest.class --- a/web.core.syntax/nbproject/project.xml +++ a/web.core.syntax/nbproject/project.xml @@ -155,8 +155,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.core.syntax/src/org/netbeans/modules/web/core/syntax/deprecated/ELDrawLayerFactory.java +++ a/web.core.syntax/src/org/netbeans/modules/web/core/syntax/deprecated/ELDrawLayerFactory.java @@ -1,192 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ - -package org.netbeans.modules.web.core.syntax.deprecated; - -import org.netbeans.modules.web.core.syntax.deprecated.ELLayerTokenContext; -import org.netbeans.modules.web.core.syntax.*; -import javax.swing.text.BadLocationException; -import javax.swing.event.DocumentListener; -import javax.swing.event.DocumentEvent; -import org.netbeans.editor.BaseDocument; -import org.netbeans.editor.BaseDocumentEvent; -import org.netbeans.editor.Coloring; -import org.netbeans.editor.DrawContext; -import org.netbeans.editor.DrawLayer; -import org.netbeans.editor.MarkFactory; -import org.netbeans.editor.FinderFactory; -import org.netbeans.editor.Analyzer; - -/** -* Various EL-layers -* -* @author Petr Pisl -* @deprecated Will be replaced by Semantic Coloring -*/ - -public class ELDrawLayerFactory { - - public static final String EL_LAYER_NAME = "jsp-el-layer"; // NOI18N - - public static final int EL_LAYER_VISIBILITY = 1010; - - /** Layer that colors extra EL information like the methods or special - * characters in the character and string literals. - */ - public static class ELLayer extends DrawLayer.AbstractLayer { - - /** End of the area that is resolved right now. It saves - * repetitive searches for '(' for multiple fragments - * inside one identifier token. - */ - private int resolvedEndOffset; - - private boolean resolvedValue; - - private NonWhitespaceFwdFinder nwFinder = new NonWhitespaceFwdFinder(); - - public ELLayer() { - super(EL_LAYER_NAME); - } - - public void init(DrawContext ctx) { - resolvedEndOffset = 0; // nothing resolved - } - - public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { - int nextOffset = ctx.getTokenOffset() + ctx.getTokenLength(); - - setNextActivityChangeOffset(nextOffset); - return true; - } - - protected Coloring getMethodColoring(DrawContext ctx) { - - /*TokenContextPath path = ctx.getTokenContextPath().replaceStart( - ELLayerTokenContext.contextPath); - return ctx.getEditorUI().getColoring( - path.getFullTokenName(ELLayerTokenContext.METHOD)); - */ - - return ctx.getEditorUI().getColoring(ELLayerTokenContext.contextPath.getFullTokenName(ELLayerTokenContext.METHOD)); - } - - private boolean isMethod(DrawContext ctx) { - - int idEndOffset = ctx.getTokenOffset() + ctx.getTokenLength(); - if (idEndOffset > resolvedEndOffset) { // beyond the resolved area - resolvedEndOffset = idEndOffset; // will resolve now - int endOffset = ctx.getEndOffset(); - int bufferStartOffset = ctx.getBufferStartOffset(); - char[] buffer = ctx.getBuffer(); - int nwOffset = Analyzer.findFirstNonWhite(buffer, - idEndOffset - bufferStartOffset, - endOffset - idEndOffset); - if (nwOffset >= 0) { // found non-white - resolvedValue = (buffer[nwOffset] == '('); - } else { // must resolve after buffer end - try { - resolvedValue = (ctx.getEditorUI().getDocument().find( - nwFinder, endOffset, -1) >= 0) - && (nwFinder.getFoundChar() == '('); - } catch (BadLocationException e) { - resolvedValue = false; - } - } - } - return resolvedValue; - } - /** Update draw context by setting colors, fonts and possibly other draw - * properties. - * The method can use information from the context to find where the painting - * process is currently located. It is called only if the layer is active. - */ - public void updateContext(DrawContext ctx) { - if (ctx.getTokenID() == ELTokenContext.IDENTIFIER && isMethod(ctx)) { - Coloring mc = getMethodColoring(ctx); - if (mc != null) { - mc.apply(ctx); - } - } - } - - } - - /** Find first non-white character forward */ - static class NonWhitespaceFwdFinder extends FinderFactory.GenericFwdFinder { - - private char foundChar; - - public char getFoundChar() { - return foundChar; - } - - protected int scan(char ch, boolean lastChar) { - if (!Character.isWhitespace(ch)) { - found = true; - foundChar = ch; - return 0; - } - return 1; - } - } - - /** Find first non-white character backward */ - public static class NonWhitespaceBwdFinder extends FinderFactory.GenericBwdFinder { - - private char foundChar; - - public char getFoundChar() { - return foundChar; - } - - protected int scan(char ch, boolean lastChar) { - if (!Character.isWhitespace(ch)) { - found = true; - foundChar = ch; - return 0; - } - return -1; - } - } - -} - --- a/web.core/nbproject/project.properties +++ a/web.core/nbproject/project.properties @@ -39,4 +39,4 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=2.8.0 +spec.version.base=2.9.0 --- a/web.core/nbproject/project.xml +++ a/web.core/nbproject/project.xml @@ -127,8 +127,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.jsf.editor/manifest.mf +++ a/web.jsf.editor/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.web.jsf.editor OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/editor/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/editor/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.4 +OpenIDE-Module-Specification-Version: 1.5 AutoUpdate-Show-In-Client: false --- a/web.jsf.editor/nbproject/project.properties +++ a/web.jsf.editor/nbproject/project.properties @@ -63,4 +63,4 @@ # /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/dt.jar:\ # /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jsse.jar:\ # /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/jce.jar -# +# --- a/web.jsf.editor/nbproject/project.xml +++ a/web.jsf.editor/nbproject/project.xml @@ -80,8 +80,8 @@ - 1 - 1.40 + 2 + 2.1 --- a/web.jsf.navigation/manifest.mf +++ a/web.jsf.navigation/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.web.jsf.navigation/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/web/jsf/navigation/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/web/jsf/navigation/mf-layer.xml -OpenIDE-Module-Specification-Version: 2.7 +OpenIDE-Module-Specification-Version: 2.8 AutoUpdate-Show-In-Client: false --- a/web.jsf.navigation/nbproject/project.xml +++ a/web.jsf.navigation/nbproject/project.xml @@ -53,8 +53,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.jsf/nbproject/project.properties +++ a/web.jsf/nbproject/project.properties @@ -38,7 +38,7 @@ # made subject to such option by the copyright holder. javac.source=1.5 -spec.version.base=1.16.0 +spec.version.base=1.17.0 test.qa-functional.cp.extra=\ --- a/web.jsf/nbproject/project.xml +++ a/web.jsf/nbproject/project.xml @@ -165,8 +165,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.refactoring/nbproject/project.properties +++ a/web.refactoring/nbproject/project.properties @@ -1,4 +1,4 @@ javac.compilerargs=-Xlint -Xlint:-serial javac.source=1.5 -spec.version.base=1.7.0 +spec.version.base=1.8.0 --- a/web.refactoring/nbproject/project.xml +++ a/web.refactoring/nbproject/project.xml @@ -44,8 +44,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/web.struts/nbproject/project.properties +++ a/web.struts/nbproject/project.properties @@ -39,7 +39,7 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.12.0 +spec.version.base=1.13.0 extra.module.files=\ modules/ext/struts/antlr-2.7.2.jar,\ --- a/web.struts/nbproject/project.xml +++ a/web.struts/nbproject/project.xml @@ -117,8 +117,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/websvc.core/nbproject/project.properties +++ a/websvc.core/nbproject/project.properties @@ -39,6 +39,6 @@ javac.compilerargs=-Xlint:unchecked javac.source=1.5 -spec.version.base=1.15.0 +spec.version.base=1.16.0 javadoc.arch=${basedir}/arch.xml --- a/websvc.core/nbproject/project.xml +++ a/websvc.core/nbproject/project.xml @@ -138,8 +138,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/websvc.saas.codegen/manifest.mf +++ a/websvc.saas.codegen/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.websvc.saas.codegen OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/codegen/Bundle.properties -OpenIDE-Module-Specification-Version: 1.6 +OpenIDE-Module-Specification-Version: 1.7 AutoUpdate-Show-In-Client: false --- a/websvc.saas.codegen/nbproject/project.xml +++ a/websvc.saas.codegen/nbproject/project.xml @@ -64,8 +64,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.retriever/manifest.mf +++ a/xml.retriever/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 -OpenIDE-Module-Specification-Version: 1.8 +OpenIDE-Module-Specification-Version: 1.9 OpenIDE-Module: org.netbeans.modules.xml.retriever/1 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/retriever/Bundle.properties --- a/xml.retriever/nbproject/project.xml +++ a/xml.retriever/nbproject/project.xml @@ -77,8 +77,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.schema.completion/manifest.mf +++ a/xml.schema.completion/manifest.mf @@ -2,5 +2,5 @@ OpenIDE-Module: org.netbeans.modules.xml.schema.completion OpenIDE-Module-Layer: org/netbeans/modules/xml/schema/completion/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/schema/completion/Bundle.properties -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 AutoUpdate-Show-In-Client: false --- a/xml.schema.completion/nbproject/project.xml +++ a/xml.schema.completion/nbproject/project.xml @@ -69,8 +69,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.schema.ui.basic/manifest.mf +++ a/xml.schema.ui.basic/manifest.mf @@ -2,6 +2,6 @@ OpenIDE-Module: org.netbeans.modules.xml.schema.ui.basic/1 OpenIDE-Module-Layer: org/netbeans/modules/xml/schema/ui/basic/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/schema/ui/basic/Bundle.properties -OpenIDE-Module-Specification-Version: 1.5 +OpenIDE-Module-Specification-Version: 1.6 AutoUpdate-Show-In-Client: false --- a/xml.schema.ui.basic/nbproject/project.xml +++ a/xml.schema.ui.basic/nbproject/project.xml @@ -77,8 +77,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.schema/manifest.mf +++ a/xml.schema/manifest.mf @@ -3,4 +3,4 @@ OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xml/schema/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/xml/schema/resources/mf-layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.17 +OpenIDE-Module-Specification-Version: 1.18 --- a/xml.schema/nbproject/project.xml +++ a/xml.schema/nbproject/project.xml @@ -86,8 +86,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.text/nbproject/project.properties +++ a/xml.text/nbproject/project.properties @@ -38,7 +38,7 @@ # made subject to such option by the copyright holder. javac.source=1.5 -spec.version.base=1.21.0 +spec.version.base=1.22.0 test.unit.cp.extra=${openide.dir}/core/openide.jar:${openide.loaders.dir}/core/openide-loaders.jar test.unit.run.cp.extra=${test.unit.cp.extra} --- a/xml.text/nbproject/project.xml +++ a/xml.text/nbproject/project.xml @@ -123,8 +123,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml.text/src/org/netbeans/modules/xml/text/syntax/XMLKit.java +++ a/xml.text/src/org/netbeans/modules/xml/text/syntax/XMLKit.java @@ -348,14 +348,5 @@ public XMLEditorDocument(String mimeType) { super(mimeType); } - - public @Override boolean addLayer(DrawLayer layer, int visibility) { - //filter out the syntax layer adding - if(!(layer instanceof DrawLayerFactory.SyntaxLayer)) { - return super.addLayer(layer, visibility); - } else { - return false; - } - } } } --- a/xml.xdm/nbproject/project.properties +++ a/xml.xdm/nbproject/project.properties @@ -42,6 +42,6 @@ is.autoload=true javac.source=1.5 javadoc.arch=${basedir}/arch.xml -spec.version.base=1.9.0 +spec.version.base=1.10.0 test.unit.jvmargs=-Xmx128m xtest.jvm.args=-Xmx128m --- a/xml.xdm/nbproject/project.xml +++ a/xml.xdm/nbproject/project.xml @@ -51,8 +51,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xml/manifest.mf +++ a/xml/manifest.mf @@ -4,4 +4,4 @@ OpenIDE-Module-Install: org/netbeans/modules/xml/CoreModuleInstall.class OpenIDE-Module-Layer: org/netbeans/modules/xml/resources/mf-layer.xml AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.7 +OpenIDE-Module-Specification-Version: 1.8 --- a/xml/nbproject/project.xml +++ a/xml/nbproject/project.xml @@ -69,8 +69,8 @@ - 1 - 1.27 + 2 + 2.1 --- a/xslt.core/manifest.mf +++ a/xslt.core/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 AutoUpdate-Show-In-Client: false -OpenIDE-Module-Specification-Version: 1.3 +OpenIDE-Module-Specification-Version: 1.4 OpenIDE-Module: org.netbeans.modules.xslt.core/1 OpenIDE-Module-Layer: org/netbeans/modules/xslt/core/resources/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/xslt/core/resources/Bundle.properties --- a/xslt.core/nbproject/project.xml +++ a/xslt.core/nbproject/project.xml @@ -77,8 +77,8 @@ - 1 - 1.27 + 2 + 2.1