jvi-cvs Mailing List for JavaVi - vi/vim editor clone
Brought to you by:
err
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
(64) |
May
(79) |
Jun
(87) |
Jul
(54) |
Aug
(16) |
Sep
(55) |
Oct
(3) |
Nov
(19) |
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(16) |
Feb
(43) |
Mar
|
Apr
(9) |
May
(5) |
Jun
(29) |
Jul
(54) |
Aug
(4) |
Sep
|
Oct
|
Nov
(13) |
Dec
|
| 2009 |
Jan
(2) |
Feb
(14) |
Mar
(28) |
Apr
|
May
(2) |
Jun
(24) |
Jul
(23) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(16) |
| 2010 |
Jan
(24) |
Feb
(19) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ernie R. <er...@us...> - 2010-02-12 19:01:28
|
Update of /cvsroot/jvi/nbvi/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9053/nbvi/nbproject Modified Files: project.properties Log Message: - fix another corner case with PLAT-SEL Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbproject/project.properties,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** project.properties 1 Feb 2010 21:03:52 -0000 1.33 --- project.properties 12 Feb 2010 19:01:19 -0000 1.34 *************** *** 5,7 **** nbm.module.author=Ernie Rael nbm.needs.restart=true ! spec.version.base=1.2.7 --- 5,7 ---- nbm.module.author=Ernie Rael nbm.needs.restart=true ! spec.version.base=1.2.8 |
|
From: Ernie R. <er...@us...> - 2010-02-12 19:01:28
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9053/jvi/src/com/raelity/jvi Modified Files: ViManager.java Log Message: - fix another corner case with PLAT-SEL Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** ViManager.java 8 Feb 2010 20:23:35 -0000 1.232 --- ViManager.java 12 Feb 2010 19:01:20 -0000 1.233 *************** *** 109,113 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.8.x1"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- 109,113 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.8"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; *************** *** 889,892 **** --- 889,893 ---- buf.activateOptions(textView); textView.activateOptions(textView); + setHasSelection(); if(newTextView) { firePropertyChange(P_OPEN_WIN, currentTv, textView); *************** *** 1007,1010 **** --- 1008,1018 ---- } + private static void setHasSelection() + { + ViTextView tv = getCurrentTextView(); + if(tv != null) + hasSelection = tv.hasSelection(); + } + public static void cursorChange(ViCaret caret) { |
|
From: Ernie R. <er...@us...> - 2010-02-12 19:01:28
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9053/nbvi/nbvi-suite/jvi-wrapper/nbproject Modified Files: project.properties Log Message: - fix another corner case with PLAT-SEL Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/nbproject/project.properties,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** project.properties 1 Feb 2010 21:03:51 -0000 1.29 --- project.properties 12 Feb 2010 19:01:18 -0000 1.30 *************** *** 7,9 **** nbm.homepage=http://jvi.sourceforge.net/ nbm.module.author=Ernie Rael ! spec.version.base=1.2.7 --- 7,9 ---- nbm.homepage=http://jvi.sourceforge.net/ nbm.module.author=Ernie Rael ! spec.version.base=1.2.8 |
|
From: Ernie R. <er...@us...> - 2010-02-12 19:01:28
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9053/nbvi/nbvi-suite/jvi-wrapper Modified Files: manifest.mf Log Message: - fix another corner case with PLAT-SEL Index: manifest.mf =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/manifest.mf,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** manifest.mf 1 Feb 2010 21:03:52 -0000 1.18 --- manifest.mf 12 Feb 2010 19:01:20 -0000 1.19 *************** *** 1,5 **** Manifest-Version: 1.0 OpenIDE-Module: com.raelity.jvi/0 ! OpenIDE-Module-Implementation-Version: 17 OpenIDE-Module-Localizing-Bundle: com/raelity/jvi/Bundle.properties --- 1,5 ---- Manifest-Version: 1.0 OpenIDE-Module: com.raelity.jvi/0 ! OpenIDE-Module-Implementation-Version: 18 OpenIDE-Module-Localizing-Bundle: com/raelity/jvi/Bundle.properties |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:43
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi/swing In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/jvi/src/com/raelity/jvi/swing Modified Files: StatusDisplay.java Log Message: - fix visual problem with PLAT-SEL state Index: StatusDisplay.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/StatusDisplay.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StatusDisplay.java 1 Feb 2010 00:13:31 -0000 1.8 --- StatusDisplay.java 8 Feb 2010 20:23:35 -0000 1.9 *************** *** 101,104 **** --- 101,112 ---- + public void clearDisplay() + { + setText(generalStatus, ""); + setText(modeStatus, ""); + setText(strokeStatus, ""); + } + + synchronized void setText( JLabel l00, String s00 ) { |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:43
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-project/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/nbvi/nbvi-suite/jvi-project/nbproject Modified Files: project.properties Log Message: - fix visual problem with PLAT-SEL state Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-project/nbproject/project.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** project.properties 28 Dec 2009 20:04:10 -0000 1.6 --- project.properties 8 Feb 2010 20:23:35 -0000 1.7 *************** *** 37,41 **** ${build.classes.dir}:\ ${libs.junit.classpath} ! javadoc.additionalparam=-overview C:\\a\\src\\jvi-dev\\jvi\\src/com/raelity/jvi/overview.html -link http://java.sun.com/j2se/1.5.0/docs/api javadoc.author=false javadoc.encoding= --- 37,41 ---- ${build.classes.dir}:\ ${libs.junit.classpath} ! javadoc.additionalparam=-overview C:\\a\\src\\jvi-dev\\jvi-1.2.7\\jvi\\src/com/raelity/jvi/overview.html -link http://java.sun.com/j2se/1.5.0/docs/api javadoc.author=false javadoc.encoding= |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:43
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/jvi/src/com/raelity/jvi Modified Files: ViManager.java ViStatusDisplay.java Log Message: - fix visual problem with PLAT-SEL state Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** ViManager.java 1 Feb 2010 21:03:51 -0000 1.231 --- ViManager.java 8 Feb 2010 20:23:35 -0000 1.232 *************** *** 109,113 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- 109,113 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.8.x1"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; *************** *** 702,705 **** --- 702,709 ---- if(ep != null && enabled) factory.setupCaret(ep); + + if(G.curwin != null) + G.curwin.getStatusDisplay().refresh(); + if(appHandle == null) return; *************** *** 724,729 **** } // For several reasons, eg. don't want to hold begin/endUndo ! if(enabled) exitInputMode(); currentlyActive = null; --- 728,735 ---- } // For several reasons, eg. don't want to hold begin/endUndo ! if(enabled) { exitInputMode(); + G.curwin.getStatusDisplay().clearDisplay(); + } currentlyActive = null; *************** *** 889,893 **** } if(textView.getBuffer().singleShare()) ! firePropertyChange(P_OPEN_BUF, currentTv == null ? null : currentTv.getBuffer(), textView.getBuffer()); firePropertyChange(P_SWITCH_TO_WIN, currentTv, textView); --- 895,900 ---- } if(textView.getBuffer().singleShare()) ! firePropertyChange(P_OPEN_BUF, ! currentTv == null ? null : currentTv.getBuffer(), textView.getBuffer()); firePropertyChange(P_SWITCH_TO_WIN, currentTv, textView); *************** *** 1002,1005 **** --- 1009,1015 ---- public static void cursorChange(ViCaret caret) { + if(G.curwin == null) + return; + boolean nowSelection = caret.getDot() != caret.getMark(); if(hasSelection == nowSelection) Index: ViStatusDisplay.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViStatusDisplay.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ViStatusDisplay.java 14 Jun 2007 03:23:56 -0000 1.5 --- ViStatusDisplay.java 8 Feb 2010 20:23:35 -0000 1.6 *************** *** 56,59 **** --- 56,62 ---- /** Clear current status and/or error message */ public void clearMessage(); + + /** Clear display */ + public void clearDisplay(); /** Redisplay last message. May be noop depending on implementation. |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:43
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-project In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/nbvi/nbvi-suite/jvi-project Modified Files: build.xml Log Message: - fix visual problem with PLAT-SEL state Index: build.xml =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-project/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 11 Feb 2007 07:08:57 -0000 1.1 --- build.xml 8 Feb 2010 20:23:35 -0000 1.2 *************** *** 3,6 **** --- 3,11 ---- <!-- some examples of how to customize the build. --> <!-- (If you delete it and reopen the project it will be recreated.) --> + <!-- By default, only the Clean and Build commands use this build script. --> + <!-- Commands such as Run, Debug, and Test only use this build script if --> + <!-- the Compile on Save feature is turned off for the project. --> + <!-- You can turn off the Compile on Save (or Deploy on Save) setting --> + <!-- in the project's Project Properties dialog box.--> <project name="jvi-project" default="default" basedir="."> <description>Builds, tests, and runs the project jvi-project.</description> |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:43
|
Update of /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/nbvi/src/org/netbeans/modules/jvi Modified Files: NbStatusDisplay.java Log Message: - fix visual problem with PLAT-SEL state Index: NbStatusDisplay.java =================================================================== RCS file: /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi/NbStatusDisplay.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NbStatusDisplay.java 1 Feb 2010 00:13:31 -0000 1.18 --- NbStatusDisplay.java 8 Feb 2010 20:23:35 -0000 1.19 *************** *** 51,56 **** private String mode = ""; private boolean fFrozen; ! // NOTE: StatusDisplayer.Message only on 6.7 ! private StatusDisplayer.Message sdMsg; // a few things for working with the netbeans status bar. --- 51,57 ---- private String mode = ""; private boolean fFrozen; ! ! // NOTE: StatusDisplayer.Message ! private static StatusDisplayer.Message sdMsg; // a few things for working with the netbeans status bar. *************** *** 186,189 **** --- 187,195 ---- } + public void clearDisplay() { + // don't change any status state, just do it + setText(StatusBar.CELL_MAIN, ""); + } + public void refresh() { setText(StatusBar.CELL_MAIN, modeString() + lastMsg + lastCmd, lastMsgColoring); |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:42
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/nbvi/nbvi-suite/nbproject Modified Files: platform.properties project.properties Log Message: - fix visual problem with PLAT-SEL state Index: platform.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/nbproject/platform.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** platform.properties 11 Feb 2007 07:09:56 -0000 1.1 --- platform.properties 8 Feb 2010 20:23:34 -0000 1.2 *************** *** 1 **** --- 1,14 ---- + cluster.path=\ + ${nbplatform.active.dir}/apisupport:\ + ${nbplatform.active.dir}/harness:\ + ${nbplatform.active.dir}/ide:\ + ${nbplatform.active.dir}/java:\ + ${nbplatform.active.dir}/nb:\ + ${nbplatform.active.dir}/platform:\ + ${nbplatform.active.dir}/websvccommon + # Deprecated since 5.0u1; for compatibility with 5.0: + ### disabled.clusters=\ + ### gsf1,\ + ### profiler3 + nbjdk.active=JDK_1.5 nbplatform.active=default Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/nbproject/project.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** project.properties 11 Feb 2007 07:09:56 -0000 1.1 --- project.properties 8 Feb 2010 20:23:35 -0000 1.2 *************** *** 4,5 **** --- 4,7 ---- project.com.raelity.jvi=jvi-wrapper project.org.netbeans.modules.jvi=.. + run.args.extra= -J-Dcom.raelity.jvi.DEBUG + #run.args.extra=--laf javax.swing.plaf.metal.MetalLookAndFeel \ No newline at end of file |
|
From: Ernie R. <er...@us...> - 2010-02-08 20:23:42
|
Update of /cvsroot/jvi/nbvi/nbvi-suite In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22705/nbvi/nbvi-suite Modified Files: build.xml Log Message: - fix visual problem with PLAT-SEL state Index: build.xml =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 11 Feb 2007 07:09:56 -0000 1.1 --- build.xml 8 Feb 2010 20:23:35 -0000 1.2 *************** *** 6,8 **** --- 6,14 ---- <description>Builds the module suite nbvi-suite.</description> <import file="nbproject/build-impl.xml"/> + + <target name="mydebug" depends="-jdk-init,-jdk-presetdef-nbjpdastart" description="Runs this suite in place in the debugger."> + <ant antfile="${harness.dir}/run.xml" target="debug"> + <reference refid="cluster.path.id"/> + </ant> + </target> </project> |
|
From: Ernie R. <er...@us...> - 2010-02-01 21:04:00
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv514/jvi/src/com/raelity/jvi Modified Files: Normal.java ViManager.java Log Message: - fix setup of '< '> and for gv at end of do_pend... sel==excl (old bug) - bump version to 1.2.7 Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.230 retrieving revision 1.231 diff -C2 -d -r1.230 -r1.231 *** ViManager.java 1 Feb 2010 00:13:30 -0000 1.230 --- ViManager.java 1 Feb 2010 21:03:51 -0000 1.231 *************** *** 109,116 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x24"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; ! public static final String PREFS_ROOT = "com/raelity/jvi"; public static final String PREFS_KEYS = "KeyBindings"; --- 109,116 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; ! public static final String PREFS_ROOT = "com/raelity/jvi"; public static final String PREFS_KEYS = "KeyBindings"; Index: Normal.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Normal.java,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** Normal.java 1 Feb 2010 00:13:30 -0000 1.100 --- Normal.java 1 Feb 2010 21:03:51 -0000 1.101 *************** *** 1385,1388 **** --- 1385,1393 ---- cap.count1 = 1; } else if (G.VIsual_active) { + /* Save the current VIsual area for '< and '> marks, and "gv" */ + G.curbuf.b_visual_start.setMark(G.VIsual); + G.curbuf.b_visual_end.setMark(cursor); + G.curbuf.b_visual_mode = G.VIsual_mode; + /* In Select mode, a linewise selection is operated upon like a * characterwise selection. */ *************** *** 1397,1409 **** G.VIsual_mode = 'v'; } ! /* If 'selection' is "exclusive", backup one character for ! * charwise selections. */ ! if (!G.VIsual_select && G.VIsual_mode == 'v') ! unadjust_for_sel(); ! ! /* Save the current VIsual area for '< and '> marks, and "gv" */ ! G.curbuf.b_visual_start.setMark(G.VIsual); ! G.curbuf.b_visual_end.setMark(cursor); ! G.curbuf.b_visual_mode = G.VIsual_mode; oap.start = G.VIsual; --- 1402,1411 ---- G.VIsual_mode = 'v'; } ! /* If 'selection' is "exclusive", backup one character for ! * charwise selections. */ ! else if(G.VIsual_mode == 'v') { ! //# ifdef FEAT_VIRTUALEDIT... ! unadjust_for_sel(); ! } oap.start = G.VIsual; |
|
From: Ernie R. <er...@us...> - 2010-02-01 21:04:00
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv514/nbvi/nbvi-suite/jvi-wrapper/nbproject Modified Files: project.properties Log Message: - fix setup of '< '> and for gv at end of do_pend... sel==excl (old bug) - bump version to 1.2.7 Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/nbproject/project.properties,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** project.properties 19 Jul 2009 00:15:55 -0000 1.28 --- project.properties 1 Feb 2010 21:03:51 -0000 1.29 *************** *** 7,9 **** nbm.homepage=http://jvi.sourceforge.net/ nbm.module.author=Ernie Rael ! spec.version.base=1.2.6 --- 7,9 ---- nbm.homepage=http://jvi.sourceforge.net/ nbm.module.author=Ernie Rael ! spec.version.base=1.2.7 |
|
From: Ernie R. <er...@us...> - 2010-02-01 21:03:59
|
Update of /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv514/nbvi/nbvi-suite/jvi-wrapper Modified Files: manifest.mf Log Message: - fix setup of '< '> and for gv at end of do_pend... sel==excl (old bug) - bump version to 1.2.7 Index: manifest.mf =================================================================== RCS file: /cvsroot/jvi/nbvi/nbvi-suite/jvi-wrapper/manifest.mf,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** manifest.mf 19 Jul 2009 00:15:55 -0000 1.17 --- manifest.mf 1 Feb 2010 21:03:52 -0000 1.18 *************** *** 1,5 **** Manifest-Version: 1.0 OpenIDE-Module: com.raelity.jvi/0 ! OpenIDE-Module-Implementation-Version: 16 OpenIDE-Module-Localizing-Bundle: com/raelity/jvi/Bundle.properties --- 1,5 ---- Manifest-Version: 1.0 OpenIDE-Module: com.raelity.jvi/0 ! OpenIDE-Module-Implementation-Version: 17 OpenIDE-Module-Localizing-Bundle: com/raelity/jvi/Bundle.properties |
|
From: Ernie R. <er...@us...> - 2010-02-01 21:03:59
|
Update of /cvsroot/jvi/nbvi/nbproject In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv514/nbvi/nbproject Modified Files: project.properties Log Message: - fix setup of '< '> and for gv at end of do_pend... sel==excl (old bug) - bump version to 1.2.7 Index: project.properties =================================================================== RCS file: /cvsroot/jvi/nbvi/nbproject/project.properties,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** project.properties 19 Jul 2009 00:15:55 -0000 1.32 --- project.properties 1 Feb 2010 21:03:52 -0000 1.33 *************** *** 5,7 **** nbm.module.author=Ernie Rael nbm.needs.restart=true ! spec.version.base=1.2.6 --- 5,7 ---- nbm.module.author=Ernie Rael nbm.needs.restart=true ! spec.version.base=1.2.7 |
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7479/jvi/src/com/raelity/jvi Modified Files: ViFactory.java Normal.java Misc.java ViManager.java Search.java ViTextView.java Window.java Log Message: - While a java text selection, change cursor to vertical bar and put status message indiating a java selection - Clean up conversion between java selection and visual mode - Clean up the caret implementations Index: Search.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Search.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** Search.java 29 Jan 2010 07:27:23 -0000 1.53 --- Search.java 1 Feb 2010 00:13:30 -0000 1.54 *************** *** 1073,1077 **** new_pos = G.curwin.validateCursorPosition(new_pos); } ! G.curwin.setSelect(new_pos, new_pos + search_match_len); G.curwin.w_set_curswant = true; if(wmsg != null) { --- 1073,1077 ---- new_pos = G.curwin.validateCursorPosition(new_pos); } ! G.curwin.setSelection(new_pos, new_pos + search_match_len); G.curwin.w_set_curswant = true; if(wmsg != null) { *************** *** 1335,1339 **** if(flags.testAnyBits(SUBST_CONFIRM) && ! flags.testAnyBits(SUBST_DID_ACK)) { ! G.curwin.setSelect(segOffsetToDoc + prog.start(0), segOffsetToDoc + prog.stop(0) + (prog.length(0) == 0 ? 1 : 0)); --- 1335,1339 ---- if(flags.testAnyBits(SUBST_CONFIRM) && ! flags.testAnyBits(SUBST_DID_ACK)) { ! G.curwin.setSelection(segOffsetToDoc + prog.start(0), segOffsetToDoc + prog.stop(0) + (prog.length(0) == 0 ? 1 : 0)); Index: Normal.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Normal.java,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** Normal.java 29 Jan 2010 07:27:22 -0000 1.99 --- Normal.java 1 Feb 2010 00:13:30 -0000 1.100 *************** *** 68,72 **** static int old_mapped_len = 0; ! static boolean cursorShapeHACK; --- 68,72 ---- static int old_mapped_len = 0; ! private static boolean cursorShapeHACK; *************** *** 2420,2433 **** // This is kind of the idea of the command. // VIM: G.VIsual_select = !G.VIsual_select; int textMark = G.VIsual.getOffset(); end_visual_mode(); // stop Visual Misc.check_cursor_col(); // make sure cursor is not beyond EOL - int textDot = G.curwin.w_cursor.getOffset(); G.curwin.w_set_curswant = true; update_curbuf(NOT_VALID); Misc.showmode(); ! //if(textDot < textMark) ! // textMark++; ! G.curwin.setSelect(textDot, textMark); } else if (!checkclearop(cap.oap)) --- 2420,2440 ---- // This is kind of the idea of the command. // VIM: G.VIsual_select = !G.VIsual_select; + + // The java selection does not include the caret. + // This converts directly when sel is exclusive int textMark = G.VIsual.getOffset(); + int textDot = G.curwin.w_cursor.getOffset(); end_visual_mode(); // stop Visual Misc.check_cursor_col(); // make sure cursor is not beyond EOL G.curwin.w_set_curswant = true; update_curbuf(NOT_VALID); Misc.showmode(); ! if(G.p_sel.charAt(0) != 'e') { ! if(textDot < textMark) ! textMark++; ! else ! textDot++; ! } ! G.curwin.setSelection(textDot, textMark); } else if (!checkclearop(cap.oap)) *************** *** 3809,3830 **** /** * This is used when initiating visual mode. If there is a ! * selection then use it to set the visual mode boundaries. */ static private void convertSelectionToVisual() { ! if(G.VIsual_active ! && G.curwin.getCaretPosition() != G.curwin.getMarkPosition()) { // convert a selection into a visual mode thing, // set visual start, G.VIsual, to the offset - int offset = G.curwin.getMarkPosition(); // convert a selection into a visual mode thing, ! // set visual start, G.VIsual, to the offset ViFPOS fpos = G.curwin.w_cursor.copy(); ! fpos.set(G.curbuf.getLineNumber(offset), ! G.curbuf.getColumnNumber(offset)); G.VIsual = fpos; // converting a selection into visual mode, clear the selection ! G.curwin.clearSelect(); } } --- 3816,3847 ---- /** * This is used when initiating visual mode. If there is a ! * JavaTextSelection then use it to set the visual mode boundaries. */ static private void convertSelectionToVisual() { ! if(G.VIsual_active && G.curwin.hasSelection()) { // convert a selection into a visual mode thing, // set visual start, G.VIsual, to the offset // convert a selection into a visual mode thing, ! // set visual start, G.VIsual, to the textMark ViFPOS fpos = G.curwin.w_cursor.copy(); ! ! int textMark = G.curwin.getMarkPosition(); ! int textDot = fpos.getOffset(); ! ! if(G.p_sel.charAt(0) != 'e') { ! if(textMark < textDot) ! G.curwin.w_cursor.set(fpos.getOffset()-1); ! else ! --textMark; ! } ! ! fpos.set(G.curbuf.getLineNumber(textMark), ! G.curbuf.getColumnNumber(textMark)); ! G.VIsual = fpos; // converting a selection into visual mode, clear the selection ! G.curwin.clearSelection(); } } *************** *** 4252,4257 **** G.curwin.w_set_curswant = true; update_curbuf(NOT_VALID); ! } else if (G.curwin.w_cursor.getOffset() != G.curwin.getMarkPosition()) { ! G.curwin.clearSelect(); } else if (cap.oap.op_type == OP_NOP && opnum == 0 && cap.count0 == 0 && cap.oap.regname == 0 && p_im == 0) { --- 4269,4274 ---- G.curwin.w_set_curswant = true; update_curbuf(NOT_VALID); ! } else if (G.curwin.hasSelection()) { ! G.curwin.clearSelection(); } else if (cap.oap.op_type == OP_NOP && opnum == 0 && cap.count0 == 0 && cap.oap.regname == 0 && p_im == 0) { Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.229 retrieving revision 1.230 diff -C2 -d -r1.229 -r1.230 *** ViManager.java 30 Jan 2010 05:35:49 -0000 1.229 --- ViManager.java 1 Feb 2010 00:13:30 -0000 1.230 *************** *** 39,43 **** import java.util.regex.Pattern; import javax.swing.JEditorPane; - import javax.swing.text.JTextComponent; import javax.swing.text.Keymap; --- 39,42 ---- *************** *** 48,51 **** --- 47,53 ---- import com.raelity.jvi.swing.KeyBinding; + import com.raelity.jvi.swing.ViCaret; + import java.awt.event.MouseListener; + import java.awt.event.MouseMotionListener; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; *************** *** 881,886 **** buf.activateOptions(textView); textView.activateOptions(textView); ! if(newTextView) firePropertyChange(P_OPEN_WIN, currentTv, textView); if(textView.getBuffer().singleShare()) firePropertyChange(P_OPEN_BUF, currentTv == null ? null : currentTv.getBuffer(), --- 883,891 ---- buf.activateOptions(textView); textView.activateOptions(textView); ! if(newTextView) { firePropertyChange(P_OPEN_WIN, currentTv, textView); + editorPane.addMouseListener(mouseListener); + editorPane.addMouseMotionListener(mouseMotionListener); + } if(textView.getBuffer().singleShare()) firePropertyChange(P_OPEN_BUF, currentTv == null ? null : currentTv.getBuffer(), *************** *** 964,969 **** --- 969,991 ---- } + /** The viewport has changed or scrolled, clear messages*/ + public static void viewMoveChange(ViTextView textView) + { + if(G.curwin == null) { + // this case is because switchto, does attach, does viewport init + // but G.curwin is not set yet. See switchTo(JEditorPane editorPane) + return; + } + Msg.clearMsg(); + } + + ////////////////////////////////////////////////////////////////////// + // + // Mouse interactions + // + private static boolean draggingBlockMode; private static boolean mouseDown; + private static boolean hasSelection; public static boolean isMouseDown() *************** *** 972,988 **** } /** ! * A mouse click; switch to the activated editor. ! * Pass the click on to the window and give it ! * a chance to adjust the position and whatever. */ ! public static int mouseSetDot(int pos, JTextComponent c, MouseEvent mev) { try { setJViBusy(true); - mouseDown = true; ! if(!(c instanceof JEditorPane)) { ! return pos; } --- 994,1070 ---- } + private static void uiCursorModeStuff() { + + Misc.ui_cursor_shape(); + Misc.showmode(); + } + + public static void cursorChange(ViCaret caret) + { + boolean nowSelection = caret.getDot() != caret.getMark(); + if(hasSelection == nowSelection) + return; + uiCursorModeStuff(); + hasSelection = nowSelection; + } + + private static MouseListener mouseListener = new MouseListener() { + + public void mouseClicked(MouseEvent e) + { + mouseClick(e); + } + + public void mousePressed(MouseEvent e) + { + mousePress(e); + } + + public void mouseReleased(MouseEvent e) + { + mouseRelease(e); + } + + public void mouseEntered(MouseEvent e) { } + + public void mouseExited(MouseEvent e) { } + }; + + private static MouseMotionListener mouseMotionListener + = new MouseMotionListener() + { + + public void mouseDragged(MouseEvent e) + { + mouseDrag(e); + } + + public void mouseMoved(MouseEvent e) { } + }; + /** ! * A mouse press; switch to the activated editor. */ ! public static void mousePress(MouseEvent mev) { try { setJViBusy(true); ! int mask = MouseEvent.BUTTON1_DOWN_MASK ! | MouseEvent.BUTTON2_DOWN_MASK ! | MouseEvent.BUTTON3_DOWN_MASK; ! ! if ((mev.getModifiersEx() & mask) != 0) ! mouseDown = true; ! ! if(G.dbgMouse.getBoolean()) { ! System.err.println("mousePress: " + (mouseDown ? "down " : "up ") ! + MouseEvent.getModifiersExText(mev.getModifiersEx())); ! //System.err.println(mev.getMouseModifiersText( ! // mev.getModifiers())); ! } ! ! if(!(mev.getComponent() instanceof JEditorPane)) { ! return; } *************** *** 992,1017 **** Normal.abortVisualMode(); ! JEditorPane editorPane = (JEditorPane)c; ViTextView tv = factory.getTextView(editorPane); if(tv == null) ! return pos; switchTo(editorPane); ! /*int lookFor = mev.ALT_DOWN_MASK | mev.BUTTON1_DOWN_MASK; ! int mods = mev.getModifiersEx(); ! if((mev.getModifiersEx() & lookFor) == lookFor) { ! draggingBlockMode = true; ! System.err.println("START_DRAG"); ! }*/ ! pos = tv.validateCursorPosition(pos); if(G.dbgMouse.getBoolean()) { ! System.err.println("mouseSetDot(" + pos + ") " + MouseEvent.getModifiersExText(mev.getModifiersEx())); //System.err.println(mev.getMouseModifiersText( // mev.getModifiers())); } ! return pos; } finally { setJViBusy(false); --- 1074,1120 ---- Normal.abortVisualMode(); ! JEditorPane editorPane = (JEditorPane)mev.getComponent(); ViTextView tv = factory.getTextView(editorPane); if(tv == null) ! return; switchTo(editorPane); ! ! } finally { ! setJViBusy(false); ! } ! ! } ! ! /** ! * A mouse click. ! * Pass the click on to the window and give it ! * a chance to adjust the position and whatever. ! * ! * NOTE: isMouseDown is false in swing when this method invoked. ! */ ! public static void mouseClick(MouseEvent mev) ! { ! if(mev.getComponent() != currentEditorPane) ! return; ! ! try { ! setJViBusy(true); ! ! ViTextView tv = factory.getTextView(currentEditorPane); ! int pos = tv.getCaretPosition(); ! int newPos = tv.validateCursorPosition(pos); ! if(pos != newPos) ! tv.setCaretPosition(newPos); if(G.dbgMouse.getBoolean()) { ! System.err.println("mouseClick(" + pos + ") " + MouseEvent.getModifiersExText(mev.getModifiersEx())); //System.err.println(mev.getMouseModifiersText( // mev.getModifiers())); } ! ! return; } finally { setJViBusy(false); *************** *** 1048,1063 **** } ! public static int mouseMoveDot(int pos, JTextComponent c, MouseEvent mev) { ! if(true) // NEEDSWORK: this method doesn't do anything anymore ! return pos; try { setJViBusy(true); - if(G.curwin == null || c != G.curwin.getEditorComponent()) { - return pos; - } - // // Don't automatically go into visual mode on a drag, --- 1151,1169 ---- } ! ! /*int lookFor = mev.ALT_DOWN_MASK | mev.BUTTON1_DOWN_MASK; ! int mods = mev.getModifiersEx(); ! if((mev.getModifiersEx() & lookFor) == lookFor) { ! draggingBlockMode = true; ! System.err.println("START_DRAG"); ! }*/ ! public static void mouseDrag(MouseEvent mev) { ! if(mev.getComponent() != currentEditorPane) ! return; try { setJViBusy(true); // // Don't automatically go into visual mode on a drag, *************** *** 1074,1083 **** if(G.dbgMouse.getBoolean()) { ! System.err.println("mouseMoveDot(" + pos + ") " + MouseEvent.getModifiersExText(mev.getModifiersEx())); //System.err.println(mev.getMouseModifiersText(mev.getModifiers())); } ! return pos; } finally { setJViBusy(false); --- 1180,1190 ---- if(G.dbgMouse.getBoolean()) { ! System.err.println("mouseDrag " + MouseEvent.getModifiersExText(mev.getModifiersEx())); //System.err.println(mev.getMouseModifiersText(mev.getModifiers())); } ! return; ! } finally { setJViBusy(false); *************** *** 1085,1098 **** } ! /** The viewport has changed or scrolled, clear messages*/ ! public static void viewMoveChange(ViTextView textView) ! { ! if(G.curwin == null) { ! // this case is because switchto, does attach, does viewport init ! // but G.curwin is not set yet. See switchTo(JEditorPane editorPane) ! return; ! } ! Msg.clearMsg(); ! } static public void dumpStack(String msg, boolean supressIfNotBusy) --- 1192,1198 ---- } ! ////////////////////////////////////////////////////////////////////// ! // ! // static public void dumpStack(String msg, boolean supressIfNotBusy) Index: Window.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Window.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Window.java 6 Jan 2010 02:18:44 -0000 1.14 --- Window.java 1 Feb 2010 00:13:30 -0000 1.15 *************** *** 143,147 **** * if the caret is moved by an 'external agent' (e.g. an IDE). * - * <br/>NEEDSWORK: put this in Window? * @param lastDot previos dot position * @param dot new dot position --- 143,146 ---- Index: ViFactory.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViFactory.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ViFactory.java 26 Jan 2010 00:03:40 -0000 1.35 --- ViFactory.java 1 Feb 2010 00:13:30 -0000 1.36 *************** *** 80,83 **** --- 80,86 ---- public Set<Buffer> getBufferSet(); + /** @return mode title to display when there's a java text selection */ + public String getPlatformSelectionDisplayName(); + /** For an environmental object, used for debug output */ public String getDisplayFilename(Object appHandle); Index: ViTextView.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViTextView.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** ViTextView.java 6 Jan 2010 02:18:44 -0000 1.54 --- ViTextView.java 1 Feb 2010 00:13:30 -0000 1.55 *************** *** 150,161 **** public void setCaretPosition(int offset); ! /** select a region of the screen */ ! public void setSelect(int dot, int mark); ! /** clear the select, if any, on the screen, don't move the caret */ ! public void clearSelect(); - /** Anonymous mark handling. * Count is the Nth mark forward, back. It is ignored by TOGGLE. --- 150,163 ---- public void setCaretPosition(int offset); ! /** do a platform select a region of the screen */ ! public void setSelection(int dot, int mark); ! /** is there a platform selection on the screen */ ! public boolean hasSelection(); ! ! /** clear a platform select, if any, on the screen, don't move the caret */ ! public void clearSelection(); /** Anonymous mark handling. * Count is the Nth mark forward, back. It is ignored by TOGGLE. Index: Misc.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Misc.java,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Misc.java 28 Jan 2010 03:55:07 -0000 1.103 --- Misc.java 1 Feb 2010 00:13:30 -0000 1.104 *************** *** 1117,1120 **** --- 1117,1125 ---- } + // If there's a java selection + if(G.curwin.hasSelection()) { + return SHAPE_VE; + } + return SHAPE_N; } *************** *** 4238,4241 **** --- 4243,4250 ---- } + else { + if(G.curwin.hasSelection()) + mode = ViManager.getViFactory().getPlatformSelectionDisplayName(); + } // Any "recording" string is handled by the disply function |
|
From: Ernie R. <er...@us...> - 2010-02-01 00:53:17
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi/cmd In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7479/jvi/src/com/raelity/jvi/cmd Modified Files: Jvi.java JviFrame.java Log Message: - While a java text selection, change cursor to vertical bar and put status message indiating a java selection - Clean up conversion between java selection and visual mode - Clean up the caret implementations Index: JviFrame.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/cmd/JviFrame.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** JviFrame.java 22 Feb 2009 22:04:17 -0000 1.8 --- JviFrame.java 1 Feb 2010 00:13:31 -0000 1.9 *************** *** 32,38 **** package com.raelity.jvi.cmd; import javax.swing.*; import javax.swing.border.*; - import javax.swing.text.DefaultStyledDocument; import java.awt.*; import java.awt.event.*; --- 32,38 ---- package com.raelity.jvi.cmd; + import com.raelity.jvi.swing.StatusDisplay; import javax.swing.*; import javax.swing.border.*; import java.awt.*; import java.awt.event.*; *************** *** 50,53 **** --- 50,54 ---- protected JButton optionsButton; protected JLabel generalStatusBar, strokeStatusBar, modeStatusBar; + protected StatusDisplay statusDisplay; private Color m_color1 = new java.awt.Color(142,142,142), *************** *** 63,66 **** --- 64,69 ---- try { jbInit(); + statusDisplay = new StatusDisplay(generalStatusBar, strokeStatusBar, + modeStatusBar); } catch ( Exception e ) { System.err.println( e.getClass().getName() + " thrown by JviFrame(): " + e.getMessage() ); *************** *** 87,90 **** --- 90,97 ---- } + public StatusDisplay getStatusDisplay() { + return statusDisplay; + } + /** Index: Jvi.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/cmd/Jvi.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Jvi.java 28 Dec 2009 20:04:10 -0000 1.21 --- Jvi.java 1 Feb 2010 00:13:31 -0000 1.22 *************** *** 35,39 **** import javax.swing.JEditorPane; import javax.swing.JFrame; - import javax.swing.JScrollPane; import javax.swing.JTextPane; import javax.swing.SwingUtilities; --- 35,38 ---- *************** *** 53,57 **** import com.raelity.jvi.swing.OptionsPanel; import com.raelity.jvi.swing.StatusDisplay; ! import com.raelity.jvi.swing.TextView; public class Jvi --- 52,58 ---- import com.raelity.jvi.swing.OptionsPanel; import com.raelity.jvi.swing.StatusDisplay; ! import java.util.HashMap; ! import java.util.Map; ! import javax.swing.JScrollPane; public class Jvi *************** *** 67,70 **** --- 68,74 ---- private static JviFrame m_frame2 = null; // test two jVi on same document + static Map<JEditorPane, StatusDisplay> mapJepSd + = new HashMap<JEditorPane, StatusDisplay>(); + /** *************** *** 77,80 **** --- 81,85 ---- JEditorPane editor = frame.getEditor(); + mapJepSd.put(editor, frame.getStatusDisplay()); JScrollPane scrollPane = frame.getScrollPane(); *************** *** 145,154 **** editor.setCaretColor(Color.black); - TextView tv = (TextView)ViManager.getViTextView(editor); - StatusDisplay sd = (StatusDisplay)tv.getStatusDisplay(); - sd.generalStatus = f.generalStatusBar; - sd.strokeStatus = f.strokeStatusBar; - sd.modeStatus = f.modeStatusBar; - //((BooleanOption)Options.getOption(Options.dbgKeyStrokes)).setBoolean(true); ViManager.activateAppEditor(editor, null, "Jvi.setupFrame"); --- 150,153 ---- *************** *** 192,196 **** } ! ViManager.setViFactory(new DefaultViFactory()); ColonCommands.register("dumpOptions", "dumpOptions", new ActionListener() { --- 191,195 ---- } ! ViManager.setViFactory(new DefaultViFactory(mapJepSd)); ColonCommands.register("dumpOptions", "dumpOptions", new ActionListener() { |
|
From: Ernie R. <er...@us...> - 2010-02-01 00:37:22
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi/swing In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7479/jvi/src/com/raelity/jvi/swing Modified Files: StatusDisplay.java DefaultViCaret.java TextView.java DefaultViFactory.java Log Message: - While a java text selection, change cursor to vertical bar and put status message indiating a java selection - Clean up conversion between java selection and visual mode - Clean up the caret implementations Index: TextView.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/TextView.java,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** TextView.java 26 Jan 2010 00:03:41 -0000 1.90 --- TextView.java 1 Feb 2010 00:13:31 -0000 1.91 *************** *** 95,99 **** ! public TextView( final JEditorPane editorPane ) { super(); --- 95,105 ---- ! public TextView(final JEditorPane editorPane, ViStatusDisplay statusDisplay) ! { ! //HACK for cmd.Jvi ! this(editorPane); ! this.statusDisplay = statusDisplay; ! } ! public TextView( final JEditorPane editorPane) { super(); *************** *** 138,144 **** public void startup() { - if ( statusDisplay == null ) { - statusDisplay = createStatusDisplay(); - } enableCursorSave(); } --- 144,147 ---- *************** *** 196,204 **** * @return */ - protected ViStatusDisplay createStatusDisplay() - { - return new StatusDisplay(); - } - public void attach() --- 199,202 ---- *************** *** 465,469 **** ! public void setSelect( int dot, int mark ) { Caret c = editorPane.getCaret(); --- 463,467 ---- ! public void setSelection( int dot, int mark ) { Caret c = editorPane.getCaret(); *************** *** 472,477 **** } ! public void clearSelect() { Caret c = editorPane.getCaret(); --- 470,479 ---- } + public boolean hasSelection() { + return editorPane.getSelectionStart() != editorPane.getSelectionEnd(); + } ! ! public void clearSelection() { Caret c = editorPane.getCaret(); Index: DefaultViCaret.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/DefaultViCaret.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DefaultViCaret.java 21 Jul 2008 00:27:09 -0000 1.7 --- DefaultViCaret.java 1 Feb 2010 00:13:31 -0000 1.8 *************** *** 20,37 **** package com.raelity.jvi.swing; - import java.awt.event.MouseEvent; import java.awt.Graphics; import java.awt.Rectangle; import java.lang.reflect.Method; import javax.swing.text.DefaultCaret; import javax.swing.text.JTextComponent; import com.raelity.jvi.*; ! import javax.swing.text.NavigationFilter; ! import javax.swing.text.Position.Bias; /** * This extension of {@link javax.swing.text.DefaultCaret} draws the * caret in different ways as defined by the cursor property. * // NEEDSWORK: cache the current font metric, listen to font property changes */ --- 20,39 ---- package com.raelity.jvi.swing; import java.awt.Graphics; import java.awt.Rectangle; import java.lang.reflect.Method; + import javax.swing.event.ChangeEvent; import javax.swing.text.DefaultCaret; import javax.swing.text.JTextComponent; import com.raelity.jvi.*; ! import javax.swing.event.ChangeListener; /** * This extension of {@link javax.swing.text.DefaultCaret} draws the * caret in different ways as defined by the cursor property. + * + * Turns out don't need NavigationFilter + * * // NEEDSWORK: cache the current font metric, listen to font property changes */ *************** *** 46,63 **** super(); viDelegate = new ViCaretDelegate(this); ! } ! ! @Override ! public void install(JTextComponent c) ! { ! c.setNavigationFilter(new NavFilter()); ! super.install(c); ! } ! ! @Override ! public void deinstall(JTextComponent c) ! { ! c.setNavigationFilter(null); ! super.deinstall(c); } --- 48,57 ---- super(); viDelegate = new ViCaretDelegate(this); ! addChangeListener(new ChangeListener() { ! public void stateChanged(ChangeEvent e) ! { ! ViManager.cursorChange(DefaultViCaret.this); ! } ! }); } *************** *** 104,183 **** return super.getComponent(); } - - private class NavFilter extends NavigationFilter { - - @Override - public void setDot(FilterBypass fb, int dot, Bias bias) - { - if (isMouseAction || mouseButtonDown) { - dot = ViManager.mouseSetDot(dot, mouseComponent, mouseEvent); - } - fb.setDot(dot, bias); - } - - @Override - public void moveDot(FilterBypass fb, int dot, Bias bias) - { - if (mouseButtonDown) { - dot = ViManager.mouseMoveDot(dot, mouseComponent, mouseEvent); - } - fb.moveDot(dot, bias); - } - } - - // - // Following copied from NbCaret, all have to do with mouse action - // - boolean mouseButtonDown; - - @Override - public void mousePressed(MouseEvent mouseEvent) - { - mouseButtonDown = true; - beginClickHack(mouseEvent); - super.mousePressed(mouseEvent); - endClickHack(); - } - - @Override - public void mouseReleased(MouseEvent mouseEvent) - { - beginClickHack(mouseEvent); - super.mouseReleased(mouseEvent); - ViManager.mouseRelease(mouseEvent); - endClickHack(); - mouseButtonDown = false; - } - - @Override - public void mouseClicked(MouseEvent mouseEvent) - { - beginClickHack(mouseEvent); - super.mouseClicked(mouseEvent); - endClickHack(); - } - - @Override - public void mouseDragged(MouseEvent mouseEvent) - { - beginClickHack(mouseEvent); - super.mouseDragged(mouseEvent); - endClickHack(); - } - boolean isMouseAction = false; - JTextComponent mouseComponent; - MouseEvent mouseEvent; - - private void beginClickHack(MouseEvent mouseEvent) - { - isMouseAction = true; - this.mouseEvent = mouseEvent; - mouseComponent = (JTextComponent) mouseEvent.getComponent(); - } - - private void endClickHack() - { - isMouseAction = false; - } } --- 98,101 ---- Index: StatusDisplay.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/StatusDisplay.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StatusDisplay.java 3 Jul 2008 02:27:49 -0000 1.7 --- StatusDisplay.java 1 Feb 2010 00:13:31 -0000 1.8 *************** *** 32,40 **** public class StatusDisplay implements ViStatusDisplay { ! public JLabel generalStatus; ! public JLabel strokeStatus; ! public JLabel modeStatus; private boolean fFrozen; // ............ --- 32,48 ---- public class StatusDisplay implements ViStatusDisplay { ! private JLabel generalStatus; ! private JLabel strokeStatus; ! private JLabel modeStatus; private boolean fFrozen; + public StatusDisplay(JLabel generalStatus, JLabel strokeStatus, + JLabel modeStatus) + { + this.generalStatus = generalStatus; + this.strokeStatus = strokeStatus; + this.modeStatus = modeStatus; + } + // ............ Index: DefaultViFactory.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/DefaultViFactory.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** DefaultViFactory.java 26 Jan 2010 00:03:41 -0000 1.60 --- DefaultViFactory.java 1 Feb 2010 00:13:31 -0000 1.61 *************** *** 81,84 **** --- 81,86 ---- private KeyListener keyListener; + Map<JEditorPane, StatusDisplay> mapJepSd; //HACK for cmd.Jvi + // ............ *************** *** 87,90 **** --- 89,96 ---- * Default constructor. */ + public DefaultViFactory(Map<JEditorPane, StatusDisplay> m) { //HACK for cmd.Jvi + this(); + mapJepSd = m; + } public DefaultViFactory() { *************** *** 148,151 **** --- 154,162 ---- protected ViTextView newTextView( JEditorPane editorPane ) { + if(isStandalone() && mapJepSd != null) { + StatusDisplay sd = mapJepSd.get(editorPane); + if(sd != null) + return new TextView(editorPane, sd); + } return new TextView(editorPane); } *************** *** 262,265 **** --- 273,281 ---- + public String getPlatformSelectionDisplayName() + { + return "PLATFORM-SELECTION"; + } + public ViFS getFS() { |
|
From: Ernie R. <er...@us...> - 2010-02-01 00:36:58
|
Update of /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv7479/nbvi/src/org/netbeans/modules/jvi Modified Files: NbCaret.java Module.java NbStatusDisplay.java Log Message: - While a java text selection, change cursor to vertical bar and put status message indiating a java selection - Clean up conversion between java selection and visual mode - Clean up the caret implementations Index: NbStatusDisplay.java =================================================================== RCS file: /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi/NbStatusDisplay.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NbStatusDisplay.java 18 Jul 2009 17:00:41 -0000 1.17 --- NbStatusDisplay.java 1 Feb 2010 00:13:31 -0000 1.18 *************** *** 100,103 **** --- 100,106 ---- } else if(mode.equals(Edit.VI_MODE_REPLACE)) { nbMode = "OVR"; + } else if(mode.equals(ViManager.getViFactory() + .getPlatformSelectionDisplayName())) { + nbMode = ""; } else { jviOnlyMode = true; *************** *** 202,214 **** // Only use alternate for CELL_MAIN and when sb not visible boolean useAlternate = false; ! boolean sb6dot7 = ViManager.getHackFlag(Module.HACK_SB); ! if(sb6dot7) { ! if(StatusBar.CELL_MAIN.equals(cellName) ! && !sb.isVisible()) ! useAlternate = true; ! } else { ! if(!sb.getPanel().isShowing()) ! useAlternate = true; ! } boolean allBlank = true; --- 205,211 ---- // Only use alternate for CELL_MAIN and when sb not visible boolean useAlternate = false; ! if(StatusBar.CELL_MAIN.equals(cellName) ! && !sb.isVisible()) ! useAlternate = true; boolean allBlank = true; *************** *** 219,223 **** } } ! if(sdMsg != null) { // clear a previous message sdMsg.clear(0); --- 216,220 ---- } } ! if(sdMsg != null && StatusBar.CELL_MAIN.equals(cellName)) { // clear a previous message sdMsg.clear(0); *************** *** 225,236 **** } if(useAlternate) { ! if(sb6dot7) { ! // message was just cleared, so nothing to do if new msg blank ! if(!allBlank) { ! sdMsg = StatusDisplayer.getDefault() ! .setStatusText(text, 1); ! } ! } else { ! StatusDisplayer.getDefault().setStatusText(text); } } else { --- 222,229 ---- } if(useAlternate) { ! // message was just cleared, so nothing to do if new msg blank ! if(!allBlank) { ! sdMsg = StatusDisplayer.getDefault() ! .setStatusText(text, 1); } } else { Index: NbCaret.java =================================================================== RCS file: /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi/NbCaret.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NbCaret.java 28 Dec 2009 20:04:10 -0000 1.11 --- NbCaret.java 1 Feb 2010 00:13:31 -0000 1.12 *************** *** 8,12 **** import com.raelity.jvi.swing.ViCaretDelegate; import java.awt.Graphics; ! import java.awt.event.MouseEvent; import javax.swing.text.JTextComponent; import org.netbeans.editor.ext.ExtCaret; --- 8,13 ---- import com.raelity.jvi.swing.ViCaretDelegate; import java.awt.Graphics; ! import javax.swing.event.ChangeEvent; ! import javax.swing.event.ChangeListener; import javax.swing.text.JTextComponent; import org.netbeans.editor.ext.ExtCaret; *************** *** 41,44 **** --- 42,52 ---- viDelegate = new com.raelity.jvi.swing.ViCaretDelegate(this); ViManager.setPlatformFindMatch(true); + addChangeListener(new ChangeListener() { + + public void stateChanged(ChangeEvent e) + { + ViManager.cursorChange(NbCaret.this); + } + }); } *************** *** 83,100 **** } - /* - protected synchronized void damage(Rectangle r) { - if(viDelegate.damage(this, r)) { - repaint(); - } - } - - protected void adjustVisibility(Rectangle nloc) { - Rectangle r = new Rectangle(); - viDelegate.damage(r, nloc); // broaden to encompass whole character - super.adjustVisibility(r); - } - */ - /** * Render the caret as specified by the cursor. --- 91,94 ---- *************** *** 111,175 **** return component; // from super } - - @Override - public void setDot(int i) { - if(isMouseAction || mouseButtonDown) { - i = ViManager.mouseSetDot(i, mouseComponent, mouseEvent); - } - super.setDot(i); - } - - @Override - public void moveDot(int i) { - if(mouseButtonDown) - i = ViManager.mouseMoveDot(i, mouseComponent, mouseEvent); - super.moveDot(i); - } - - boolean mouseButtonDown; - - @Override - public void mousePressed(MouseEvent mouseEvent) { - mouseButtonDown = true; - beginClickHack(mouseEvent); - super.mousePressed(mouseEvent); - endClickHack(); - } - - @Override - public void mouseReleased(MouseEvent mouseEvent) { - beginClickHack(mouseEvent); - super.mouseReleased(mouseEvent); - ViManager.mouseRelease(mouseEvent); - endClickHack(); - mouseButtonDown = false; - } - - @Override - public void mouseClicked(MouseEvent mouseEvent) { - beginClickHack(mouseEvent); - super.mouseClicked(mouseEvent); - endClickHack(); - } - @Override - public void mouseDragged(MouseEvent mouseEvent) { - beginClickHack(mouseEvent); - super.mouseDragged(mouseEvent); - endClickHack(); - } - - boolean isMouseAction = false; - JTextComponent mouseComponent; - MouseEvent mouseEvent; - - private void beginClickHack(MouseEvent mouseEvent) { - isMouseAction = true; - this.mouseEvent = mouseEvent; - mouseComponent = (JTextComponent)getEventComponent(mouseEvent); - } - - private void endClickHack() { - isMouseAction = false; - } } --- 105,108 ---- Index: Module.java =================================================================== RCS file: /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi/Module.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** Module.java 27 Jan 2010 01:06:52 -0000 1.89 --- Module.java 1 Feb 2010 00:13:31 -0000 1.90 *************** *** 135,139 **** public static final String HACK_CC = "NB6.7 Code Completion"; public static final String HACK_SCROLL = "NB6.7 Text Scroll"; - public static final String HACK_SB = "NB6.7 Status Bar"; private static TopComponentRegistryListener topComponentRegistryListener; --- 135,138 ---- *************** *** 235,239 **** ViManager.putHackMap(HACK_CC, Boolean.TRUE); ViManager.putHackMap(HACK_SCROLL, Boolean.TRUE); - ViManager.putHackMap(HACK_SB, Boolean.TRUE); } } --- 234,237 ---- |
|
From: Ernie R. <er...@us...> - 2010-01-30 05:35:58
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv11489 Modified Files: ColonCommands.java ViManager.java Log Message: - implement "[range]:<[<<<...]" and ":>" Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.228 retrieving revision 1.229 diff -C2 -d -r1.228 -r1.229 *** ViManager.java 29 Jan 2010 07:27:23 -0000 1.228 --- ViManager.java 30 Jan 2010 05:35:49 -0000 1.229 *************** *** 107,111 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x23"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- 107,111 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x24"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; Index: ColonCommands.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ColonCommands.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ColonCommands.java 22 Jan 2010 21:20:51 -0000 1.52 --- ColonCommands.java 30 Jan 2010 05:35:49 -0000 1.53 *************** *** 327,333 **** // if(sidx >= commandLine.length()) { return null; } sidx01 = sidx; ! // skip alpha characters for(; sidx < commandLine.length(); sidx++) { ! if( ! Util.isalpha(commandLine.charAt(sidx))) { break; } --- 327,339 ---- // if(sidx >= commandLine.length()) { return null; } sidx01 = sidx; ! // skip command name characters // NEEDSWORK: not just alpha for(; sidx < commandLine.length(); sidx++) { ! // NEEDSWORK: commands can be more than just alpha chars ! // for now just hack in the two non-alpha commands we've got ! //if( ! Util.isalpha(commandLine.charAt(sidx))) ! if( ! (Util.isalpha(commandLine.charAt(sidx)) ! || "<".equals(String.valueOf(commandLine.charAt(sidx))) ! || ">".equals(String.valueOf(commandLine.charAt(sidx))))) ! { break; } *************** *** 342,345 **** --- 348,352 ---- String command = commandLine.substring(sidx01, sidx02); + cev.inputCommand = command; cev.iArgString = sidx02; AbbrevLookup.CommandElement ce = m_commands.lookupCommand(command); *************** *** 577,580 **** --- 584,589 ---- /** The expanded command word */ String command; + /** The command word as input */ + String inputCommand; /** The command associated with this event */ AbbrevLookup.CommandElement commandElement; *************** *** 686,689 **** --- 695,706 ---- /** + * @return the command as it was input. May be a partial command name + */ + public String getInputCommandName() + { + return inputCommand; + } + + /** * @return the unparsed string of arguments */ *************** *** 2315,2320 **** /** ! * :delete command. ! */ static ColonAction ACTION_delete = new ColonAction() { public void actionPerformed(ActionEvent ev) --- 2332,2337 ---- /** ! * :delete command. ! */ static ColonAction ACTION_delete = new ColonAction() { public void actionPerformed(ActionEvent ev) *************** *** 2330,2345 **** /** ! * :yank command. ! */ static ColonAction ACTION_yank = new ColonAction() { public void actionPerformed(ActionEvent ev) { OPARG oa = setupExop((ColonEvent)ev, true); if(!oa.error) { ! oa.op_type = OP_YANK; ! Misc.op_yank(oa, false, true); } } }; private static class moveCopy extends ColonAction { --- 2347,2391 ---- /** ! * :yank command. ! */ static ColonAction ACTION_yank = new ColonAction() { public void actionPerformed(ActionEvent ev) { OPARG oa = setupExop((ColonEvent)ev, true); if(!oa.error) { ! oa.op_type = OP_YANK; ! Misc.op_yank(oa, false, true); } } }; + private static ColonAction ACTION_lshift = new ShiftAction(OP_LSHIFT); + private static ColonAction ACTION_rshift = new ShiftAction(OP_RSHIFT); + + private static class ShiftAction extends ColonAction + { + final int op; + + public ShiftAction(int op) + { + this.op = op; + } + + public void actionPerformed(ActionEvent ev) + { + ColonEvent cev = (ColonEvent)ev; + final OPARG oa = setupExop(cev, true); + final int amount = cev.getInputCommandName().length(); + if(!oa.error) { + oa.op_type = op; + Misc.runUndoable(new Runnable() { + public void run() + { + Misc.op_shift(oa, false, amount); + } + }); + } + } + } + private static class moveCopy extends ColonAction { *************** *** 2493,2496 **** --- 2539,2546 ---- register("y", "yank", ACTION_yank); + // not pretty, limit the number of shifts... + register(">", ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", ACTION_rshift); + register("<", "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", ACTION_lshift); + register("m", "move", ACTION_move); register("co", "copy", ACTION_copy); |
|
From: Ernie R. <er...@us...> - 2010-01-29 07:27:33
|
Update of /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1868/nbvi/src/org/netbeans/modules/jvi Modified Files: NbBuffer.java Log Message: - For 'Q' and 'gq' commands invoke platform's reformat - Fix bug in '[m' flavor of commands. Also avoid cursor motion (nice). Index: NbBuffer.java =================================================================== RCS file: /cvsroot/jvi/nbvi/src/org/netbeans/modules/jvi/NbBuffer.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** NbBuffer.java 26 Jan 2010 00:03:40 -0000 1.34 --- NbBuffer.java 29 Jan 2010 07:27:23 -0000 1.35 *************** *** 43,46 **** --- 43,47 ---- import org.netbeans.modules.editor.NbEditorKit; import org.netbeans.modules.editor.NbEditorUtilities; + import org.netbeans.modules.editor.indent.api.Reformat; import org.openide.awt.UndoRedo; import org.openide.filesystems.FileObject; *************** *** 206,209 **** --- 207,238 ---- } + @Override + public void reformat(int line, int count) { + if(getDoc() instanceof BaseDocument) { + BaseDocument doc = (BaseDocument)getDoc(); + boolean keepAtomicLock = doc.isAtomicLock(); + if(keepAtomicLock) + doc.atomicUnlock(); + Reformat reformat = Reformat.get(doc); + reformat.lock(); + try { + doc.atomicLock(); + try { + reformat.reformat(getLineStartOffset(line), + getLineEndOffset(line + count - 1)); + } catch (BadLocationException ex) { + LOG.log(Level.SEVERE, null, ex); + } finally { + if(!keepAtomicLock) + doc.atomicUnlock(); + } + } finally { + reformat.unlock(); + } + } else { + Util.vim_beep(); + } + } + ////////////////////////////////////////////////////////////////////// // |
|
From: Ernie R. <er...@us...> - 2010-01-29 07:27:31
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi/swing In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1868/jvi/src/com/raelity/jvi/swing Modified Files: DefaultBuffer.java Log Message: - For 'Q' and 'gq' commands invoke platform's reformat - Fix bug in '[m' flavor of commands. Also avoid cursor motion (nice). Index: DefaultBuffer.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/DefaultBuffer.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** DefaultBuffer.java 26 Jan 2010 00:03:41 -0000 1.20 --- DefaultBuffer.java 29 Jan 2010 07:27:23 -0000 1.21 *************** *** 248,251 **** --- 248,257 ---- public void reindent(int line, int count) { + System.err.format("reindent line %d, count %d", line, count); + Util.vim_beep(); + } + + public void reformat(int line, int count) { + System.err.format("reformat line %d, count %d", line, count); Util.vim_beep(); } |
|
From: Ernie R. <er...@us...> - 2010-01-29 07:27:31
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1868/jvi/src/com/raelity/jvi Modified Files: Options.java Normal.java ViBuffer.java ViManager.java Search.java Log Message: - For 'Q' and 'gq' commands invoke platform's reformat - Fix bug in '[m' flavor of commands. Also avoid cursor motion (nice). Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.227 retrieving revision 1.228 diff -C2 -d -r1.227 -r1.228 *** ViManager.java 28 Jan 2010 03:55:07 -0000 1.227 --- ViManager.java 29 Jan 2010 07:27:23 -0000 1.228 *************** *** 107,111 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x22"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- 107,111 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x23"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; Index: ViBuffer.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViBuffer.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ViBuffer.java 22 Jan 2010 21:20:52 -0000 1.11 --- ViBuffer.java 29 Jan 2010 07:27:23 -0000 1.12 *************** *** 67,74 **** ! /** platform indent algorithm */ public void reindent(int line, int count); /** @return the line number, 1 based, corresponding to the offset */ public int getLineNumber(int offset); --- 67,77 ---- ! /** platform indent algorithm */ public void reindent(int line, int count); + /** platform indent algorithm */ + public void reformat(int line, int count); + /** @return the line number, 1 based, corresponding to the offset */ public int getLineNumber(int offset); Index: Options.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Options.java,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** Options.java 28 Jan 2010 03:55:07 -0000 1.77 --- Options.java 29 Jan 2010 07:27:22 -0000 1.78 *************** *** 681,691 **** "are used."); ! G.p_fp = createStringOption(formatProgram, "fmt -w " + twMagic); setupOptionDesc(processList, formatProgram, "'formatprg' 'fp'", ! "The name of an external program used to format lines selected " + ! "with 'gq' operator (default \"fmt\"). The program must take " + ! "input on stdin and produce output to stdout. In Unix, " + ! "\"fmt\" is such a program. " + twMagic + " in the string is " + ! "substituted by the value of textwidth option. "); ///////////////////////////////////////////////////////////////////// --- 681,695 ---- "are used."); ! G.p_fp = createStringOption(formatProgram, ""); setupOptionDesc(processList, formatProgram, "'formatprg' 'fp'", ! "External program to use for \"qq\" or \"Q\" command (default \"\")." ! + " When this option is empty the internal formatting functions" ! + " are used." ! + "\n\n When specified, the program must take input on stdin and" ! + " send output to stdout. In Unix, \"fmt\" is such a program." ! + twMagic + " in the string is" ! + " substituted by the value of textwidth option. " ! + "\n\nTypically set to \"fmt -w #TEXT-WIDTH#\" to use external program." ! ); ///////////////////////////////////////////////////////////////////// Index: Normal.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Normal.java,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** Normal.java 28 Jan 2010 03:55:07 -0000 1.98 --- Normal.java 29 Jan 2010 07:27:22 -0000 1.99 *************** *** 606,614 **** // If ever want to support exmode, then better support // map so that 'Q' can be mapped ! if (G.VIsual_active) ! Util.vim_beep(); ! else { ! nv_operator(ca); // so both 'gq' and 'Q' map to same operator ! } break; --- 606,611 ---- // If ever want to support exmode, then better support // map so that 'Q' can be mapped ! ! nv_operator(ca); // so both 'gq' and 'Q' map to same operator break; *************** *** 1790,1797 **** } ! static void op_format(OPARG oap) { do_op("op_format"); // NEESDWORK: hook into platform's format (if available) ! op_colon(oap); } --- 1787,1799 ---- } ! static void op_format(final OPARG oap) { do_op("op_format"); // NEESDWORK: hook into platform's format (if available) ! Misc.runUndoable(new Runnable() { ! public void run() { ! G.curbuf.reformat(G.curwin.w_cursor.getLine(), ! oap.line_count); ! } ! }); } *************** *** 3090,3096 **** int c; cap.oap.motion_type = MCHAR; cap.oap.inclusive = false; ! old_pos = G.curwin.w_cursor.copy(); //#ifdef FEAT_VIRTUALEDIT ... --- 3092,3099 ---- int c; + final ViFPOS cursor = G.curwin.w_cursor.copy(); cap.oap.motion_type = MCHAR; cap.oap.inclusive = false; ! old_pos = cursor.copy(); //#ifdef FEAT_VIRTUALEDIT ... *************** *** 3174,3178 **** for ( ; n > 0; --n) { ! if ((pos = Search.findmatchlimit(cap.oap, findc, (cap.cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == null) { --- 3177,3181 ---- for ( ; n > 0; --n) { ! if ((pos = Search.findmatchlimit(cursor, cap.oap, findc, (cap.cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == null) { *************** *** 3187,3194 **** } prev_pos = new_pos == null ? null : new_pos.copy(); ! G.curwin.w_cursor.set(pos);// G.curwin.w_cursor = *pos; new_pos = pos; } ! G.curwin.w_cursor.set(old_pos); /* --- 3190,3198 ---- } prev_pos = new_pos == null ? null : new_pos.copy(); ! cursor.set(pos);// G.curwin.w_cursor = *pos; new_pos = pos; + //LOG.log(FINER, "prev {0}, new {1}", new Object[] {prev_pos, new_pos}); } ! cursor.set(old_pos); /* *************** *** 3205,3212 **** n = cap.count1; /* found a match: we were inside a method */ ! if (prev_pos == null) { pos = prev_pos; ! G.curwin.w_cursor.set(prev_pos); if (norm) --n; --- 3209,3216 ---- n = cap.count1; /* found a match: we were inside a method */ ! if (prev_pos != null) { pos = prev_pos; ! cursor.set(prev_pos); if (norm) --n; *************** *** 3218,3222 **** for (;;) { ! if ((findc == '{' ? dec_cursor() : inc_cursorV7()) < 0) { /* if not found anything, that's an error */ --- 3222,3226 ---- for (;;) { ! if ((findc == '{' ? dec(cursor) : incV7(cursor)) < 0) { /* if not found anything, that's an error */ *************** *** 3226,3230 **** break; } ! c = gchar_cursor(); if (c == '{' || c == '}') { --- 3230,3234 ---- break; } ! c = gchar_pos(cursor); if (c == '{' || c == '}') { *************** *** 3233,3237 **** if ((c == findc && norm) || (n == 1 && !norm)) { ! new_pos = G.curwin.w_cursor.copy(); pos = new_pos; n = 0; --- 3237,3241 ---- if ((c == findc && norm) || (n == 1 && !norm)) { ! new_pos = cursor.copy(); pos = new_pos; n = 0; *************** *** 3241,3254 **** else if (new_pos == null) { ! new_pos = G.curwin.w_cursor.copy(); pos = new_pos; } /* found start/end of other method: go to match */ ! else if ((pos = Search.findmatchlimit(cap.oap, findc, (cap.cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == null) n = 0; else ! G.curwin.w_cursor.set(pos); // G.curwin.w_cursor = *pos; break; } --- 3245,3259 ---- else if (new_pos == null) { ! new_pos = cursor.copy(); pos = new_pos; } /* found start/end of other method: go to match */ ! else if ((pos = Search.findmatchlimit(cursor, ! cap.oap, findc, (cap.cmdchar == '[') ? FM_BACKWARD : FM_FORWARD, 0)) == null) n = 0; else ! cursor.set(pos); // G.curwin.w_cursor = *pos; break; } *************** *** 3256,3265 **** --n; } ! G.curwin.w_cursor.set(old_pos); ! if (pos == null && new_pos == null) clearopbeep(cap.oap); } if (pos != null) { setpcmark(); G.curwin.w_cursor.set(pos); // G.curwin.w_cursor = *pos; --- 3261,3271 ---- --n; } ! cursor.set(old_pos); ! if (pos == null && new_pos != null) clearopbeep(cap.oap); } if (pos != null) { + // up to this point, w_cursor should no have been changed. setpcmark(); G.curwin.w_cursor.set(pos); // G.curwin.w_cursor = *pos; *************** *** 4821,4824 **** --- 4827,4831 ---- // //Misc + private static int dec(ViFPOS fpos) { return Misc.dec(fpos); } private static int dec_cursor() { return Misc.dec_cursor(); } private static int decl(ViFPOS pos) { return Misc.decl(pos); } Index: Search.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Search.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Search.java 9 Dec 2009 05:39:48 -0000 1.52 --- Search.java 29 Jan 2010 07:27:23 -0000 1.53 *************** *** 2009,2013 **** static ViFPOS findmatchlimit(OPARG oap, char initc, int flags, int maxtravel) { ! //ViFPOS pos; // current search position int pos_lnum; int pos_col; --- 2009,2017 ---- static ViFPOS findmatchlimit(OPARG oap, char initc, int flags, int maxtravel) { ! return findmatchlimit(G.curwin.w_cursor.copy(), oap, initc, flags, maxtravel); ! } ! static ViFPOS findmatchlimit(ViFPOS cursor, ! OPARG oap, char initc, int flags, int maxtravel) ! { int pos_lnum; int pos_col; *************** *** 2038,2044 **** assert initc != 0; ! //pos = G.curwin.w_cursor.copy(); ! pos_lnum = G.curwin.w_cursor.getLine(); ! pos_col = G.curwin.w_cursor.getColumn(); linep = Util.ml_get(pos_lnum); --- 2042,2049 ---- assert initc != 0; ! // pos_lnum = G.curwin.w_cursor.getLine(); ! // pos_col = G.curwin.w_cursor.getColumn(); ! pos_lnum = cursor.getLine(); ! pos_col = cursor.getColumn(); linep = Util.ml_get(pos_lnum); |
|
From: Ernie R. <er...@us...> - 2010-01-28 03:55:16
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16642 Modified Files: Normal.java Misc.java ViManager.java Options.java Option.java Added Files: EnumStringOption.java EnumOption.java EnumIntegerOption.java Log Message: - provide for enum/combo-box string/integer options. - various vis mode sel=exclusive issues --- NEW FILE: EnumOption.java --- /* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is jvi - vi editor clone. * * The Initial Developer of the Original Code is Ernie Rael. * Portions created by Ernie Rael are * Copyright (C) 2000 Ernie Rael. All Rights Reserved. * * Contributor(s): Ernie Rael <er...@ra...> */ package com.raelity.jvi; /** * Essentially a tag for an Option with enum values. * * Would like to have EnumOption<E> * but that's a lot more work. Since can't do * EnumOption<Integer> extends IntegerOption, everything would have to change. * Would need Option<E> as well. * * @author Ernie Rael <err at raelity.com> */ public interface EnumOption { public Object[] getAvailableValues(); } Index: Normal.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Normal.java,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** Normal.java 22 Jan 2010 21:20:51 -0000 1.97 --- Normal.java 28 Jan 2010 03:55:07 -0000 1.98 *************** *** 68,71 **** --- 68,72 ---- static int old_mapped_len = 0; + static boolean cursorShapeHACK; *************** *** 1250,1255 **** /* Redraw the cursor with another shape, if we were in Operator-pending * mode or did a replace command. */ ! if (wasFinishOp || ca.cmdchar == 'r') Misc.ui_cursor_shape(); /* may show different cursor shape */ // NEEDSWORK: The following is kind of like what vim does in screen.c --- 1251,1261 ---- /* Redraw the cursor with another shape, if we were in Operator-pending * mode or did a replace command. */ ! if (wasFinishOp || ca.cmdchar == 'r' || cursorShapeHACK) { Misc.ui_cursor_shape(); /* may show different cursor shape */ + // Without cursorShapeHACK in 'v' mode after a 'y', or a variety + // of other operators, the cursor never get back as required, + // need sel == exclusive to see it. + cursorShapeHACK = false; + } // NEEDSWORK: The following is kind of like what vim does in screen.c *************** *** 1780,1783 **** --- 1786,1790 ---- oap.block_mode = false; oap.regname = 0; + cursorShapeHACK = true; } } *************** *** 4198,4203 **** && Misc.gchar_cursor() != '\n') { ! //++curwin->w_cursor.col; ! G.curwin.setCaretPosition(G.curwin.getCaretPosition()+1); cap.oap.inclusive = false; } --- 4205,4209 ---- && Misc.gchar_cursor() != '\n') { ! G.curwin.w_cursor.incColumn(); cap.oap.inclusive = false; } Index: Option.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Option.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Option.java 11 Mar 2009 00:21:12 -0000 1.13 --- Option.java 28 Jan 2010 03:55:07 -0000 1.14 *************** *** 42,46 **** protected boolean fExpert; protected boolean fHidden; - protected String[] tags; // see PropertyEditor.getTags protected boolean fPropogate; // used in logic, not part of option type --- 42,45 ---- *************** *** 109,116 **** } - public String[] getTags() { - return tags; - } - /** * The preferences data base has changed, stay in sync. --- 108,111 ---- Index: Options.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Options.java,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** Options.java 22 Jan 2010 21:20:52 -0000 1.76 --- Options.java 28 Jan 2010 03:55:07 -0000 1.77 *************** *** 368,413 **** + " are remembered. Set to 0 and no marks are persisted."); ! G.p_sel = createStringOption(selection, "inclusive", ! new StringOption.Validator() { ! @Override ! public void validate(String val) throws PropertyVetoException { ! if("old".equals(val) ! || "inclusive".equals(val) ! || "exclusive".equals(val)) ! return; ! throw new PropertyVetoException( ! "Value must be one of 'old', 'inclusive' or 'exclusive'." ! + " Not '" + val + "'.", ! new PropertyChangeEvent(opt, opt.getName(), ! opt.getString(), val)); ! } ! }); setupOptionDesc(generalList, selection, "'selection' 'sel'", "This option defines the behavior of the selection." + " It is only used in Visual and Select mode." ! + "Possible values: 'old', 'inclusive', 'exclusive'", ! new String[] {"old", "inclusive", "exclusive"}); ! setExpertHidden(selection, true, false); ! G.p_slm = createStringOption(selectMode, "", ! new StringOption.Validator() { ! @Override ! public void validate(String val) throws PropertyVetoException { ! if ("mouse".equals(val) ! || "key".equals(val) ! || "cmd".equals(val)) ! return; ! throw new PropertyVetoException( ! "Value must be one of 'mouse', 'key' or 'cmd'." ! + " Not '" + val + "'.", ! new PropertyChangeEvent(opt, opt.getName(), ! opt.getString(), val)); ! } ! }); setupOptionDesc(generalList, selectMode, "'selectmode' 'slm'", "This is a comma separated list of words, which specifies when to" + " start Select mode instead of Visual mode, when a selection is" ! + " started. Possible values: 'mouse', key' or 'cmd'", ! new String[] {"mouse", "key", "cmd"}); setExpertHidden(selectMode, true, true); --- 368,414 ---- + " are remembered. Set to 0 and no marks are persisted."); ! G.p_sel = createEnumStringOption(selection, "inclusive", ! new String[] {"old", "inclusive", "exclusive"}); ! // not needed with enum option ! // new StringOption.Validator() { ! // @Override ! // public void validate(String val) throws PropertyVetoException { ! // if("old".equals(val) ! // || "inclusive".equals(val) ! // || "exclusive".equals(val)) ! // return; ! // throw new PropertyVetoException( ! // "Value must be one of 'old', 'inclusive' or 'exclusive'." ! // + " Not '" + val + "'.", ! // new PropertyChangeEvent(opt, opt.getName(), ! // opt.getString(), val)); ! // } ! // } setupOptionDesc(generalList, selection, "'selection' 'sel'", "This option defines the behavior of the selection." + " It is only used in Visual and Select mode." ! + "Possible values: 'old', 'inclusive', 'exclusive'"); ! setExpertHidden(selection, false, false); ! G.p_slm = createEnumStringOption(selectMode, "", ! new String[] {"mouse", "key", "cmd"}); ! // new StringOption.Validator() { ! // @Override ! // public void validate(String val) throws PropertyVetoException { ! // if ("mouse".equals(val) ! // || "key".equals(val) ! // || "cmd".equals(val)) ! // return; ! // throw new PropertyVetoException( ! // "Value must be one of 'mouse', 'key' or 'cmd'." ! // + " Not '" + val + "'.", ! // new PropertyChangeEvent(opt, opt.getName(), ! // opt.getString(), val)); ! // } ! // } setupOptionDesc(generalList, selectMode, "'selectmode' 'slm'", "This is a comma separated list of words, which specifies when to" + " start Select mode instead of Visual mode, when a selection is" ! + " started. Possible values: 'mouse', key' or 'cmd'"); setExpertHidden(selectMode, true, true); *************** *** 435,457 **** "\"<\" and \">\" round indent to multiple of shiftwidth"); ! G.p_bs = createIntegerOption(backspace, 0, ! new IntegerOption.Validator() { ! @Override ! public void validate(int val) throws PropertyVetoException { ! if(val < 0 || val > 2) { ! throw new PropertyVetoException( ! "Only 0, 1, or 2 are allowed." ! + " Not '" + val + "'.", ! new PropertyChangeEvent(opt, opt.getName(), ! opt.getInteger(), val)); ! } ! } ! }); setupOptionDesc(modifyList, backspace, "'backspace' 'bs'", "Influences the working of <BS>, <Del> during insert." + "\n 0 - no special handling." + "\n 1 - allow backspace over <EOL>." ! + "\n 2 - allow backspace over start of insert.", ! new String[] { "0", "1", "2"}); ///////////////////////// --- 436,457 ---- "\"<\" and \">\" round indent to multiple of shiftwidth"); ! G.p_bs = createEnumIntegerOption(backspace, 0, new Integer[] { 0, 1, 2}); ! //new IntegerOption.Validator() { ! //@Override ! // public void validate(int val) throws PropertyVetoException { ! // if(val < 0 || val > 2) { ! // throw new PropertyVetoException( ! // "Only 0, 1, or 2 are allowed." ! // + " Not '" + val + "'.", ! // new PropertyChangeEvent(opt, opt.getName(), ! // opt.getInteger(), val)); ! // } ! // } ! //} setupOptionDesc(modifyList, backspace, "'backspace' 'bs'", "Influences the working of <BS>, <Del> during insert." + "\n 0 - no special handling." + "\n 1 - allow backspace over <EOL>." ! + "\n 2 - allow backspace over start of insert."); ///////////////////////// *************** *** 748,752 **** return createStringOption(name, defaultValue, null); } ! static public StringOption createStringOption(String name, String defaultValue, --- 748,752 ---- return createStringOption(name, defaultValue, null); } ! static public StringOption createStringOption(String name, String defaultValue, *************** *** 759,762 **** --- 759,780 ---- } + static public EnumStringOption createEnumStringOption(String name, + String defaultValue, + String [] availableValues) { + return createEnumStringOption(name, defaultValue, null, availableValues); + } + + static public EnumStringOption createEnumStringOption(String name, + String defaultValue, + StringOption.Validator valid, + String [] availableValues) { + if(optionsMap.get(name) != null) + throw new IllegalArgumentException("Option " + name + "already exists"); + EnumStringOption opt = new EnumStringOption(name, defaultValue, + valid, availableValues); + optionsMap.put(name, opt); + return opt; + } + static public BooleanOption createBooleanOption(String name, boolean defaultValue) { *************** *** 782,785 **** --- 800,821 ---- return opt; } + + static public EnumIntegerOption createEnumIntegerOption(String name, + int defaultValue, + Integer [] availableValues) { + return createEnumIntegerOption(name, defaultValue, null, availableValues); + } + + static public EnumIntegerOption createEnumIntegerOption(String name, + int defaultValue, + IntegerOption.Validator valid, + Integer [] availableValues) { + if(optionsMap.get(name) != null) + throw new IllegalArgumentException("Option " + name + "already exists"); + EnumIntegerOption opt = new EnumIntegerOption(name, defaultValue, + valid, availableValues); + optionsMap.put(name, opt); + return opt; + } static public ColorOption createColorOption(String name, *************** *** 849,858 **** private static void setupOptionDesc(List<String> optionsGroup, String name, String displayName, String desc) { - setupOptionDesc(optionsGroup, name, displayName, desc, null); - } - - private static void setupOptionDesc(List<String> optionsGroup, String name, - String displayName, String desc, - String[] tags) { Option opt = optionsMap.get(name); if(opt != null) { --- 885,888 ---- *************** *** 865,869 **** opt.desc = desc; opt.displayName = displayName; - opt.tags = tags; } else { throw new Error("Unknown option: " + name); --- 895,898 ---- Index: ViManager.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/ViManager.java,v retrieving revision 1.226 retrieving revision 1.227 diff -C2 -d -r1.226 -r1.227 *** ViManager.java 27 Jan 2010 01:06:52 -0000 1.226 --- ViManager.java 28 Jan 2010 03:55:07 -0000 1.227 *************** *** 107,111 **** // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x21"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- 107,111 ---- // 1.0.0.beta3 is NB vers 0.9.7.5 // ! public static final jViVersion version = new jViVersion("1.2.7.x22"); private static final String DEBUG_AT_HOME = "com.raelity.jvi.DEBUG"; --- NEW FILE: EnumStringOption.java --- /* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is jvi - vi editor clone. * * The Initial Developer of the Original Code is Ernie Rael. * Portions created by Ernie Rael are * Copyright (C) 2000 Ernie Rael. All Rights Reserved. * * Contributor(s): Ernie Rael <er...@ra...> */ package com.raelity.jvi; public class EnumStringOption extends StringOption implements EnumOption { String [] availableValues; EnumStringOption(String key, String defaultValue, String[] availableValues) { this(key, defaultValue, null, availableValues); } EnumStringOption(String key, String defaultValue, StringOption.Validator validator, String[] availableValues) { super(key, defaultValue, validator); this.availableValues = availableValues; } public String[] getAvailableValues() { return availableValues; } } --- NEW FILE: EnumIntegerOption.java --- /* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is jvi - vi editor clone. * * The Initial Developer of the Original Code is Ernie Rael. * Portions created by Ernie Rael are * Copyright (C) 2000 Ernie Rael. All Rights Reserved. * * Contributor(s): Ernie Rael <er...@ra...> */ package com.raelity.jvi; public class EnumIntegerOption extends IntegerOption implements EnumOption { Integer [] availableValues; EnumIntegerOption(String key, int defaultValue, Integer[] availableValues) { this(key, defaultValue, null, availableValues); } EnumIntegerOption(String key, int defaultValue, IntegerOption.Validator validator, Integer[] availableValues) { super(key, defaultValue, validator); this.availableValues = availableValues; } public Integer[] getAvailableValues() { return availableValues; } } Index: Misc.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/Misc.java,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** Misc.java 22 Jan 2010 21:20:52 -0000 1.102 --- Misc.java 28 Jan 2010 03:55:07 -0000 1.103 *************** *** 1067,1072 **** // Set them up according to the defaults. Cursor block = new Cursor(SHAPE_BLOCK, 0, 0); ! Cursor ver25 = new Cursor(SHAPE_VER, 25, -1); ! Cursor ver35 = new Cursor(SHAPE_VER, 35, -1); Cursor hor20 = new Cursor(SHAPE_HOR, 20, 0); Cursor hor50 = new Cursor(SHAPE_HOR, 50, 0); --- 1067,1072 ---- // Set them up according to the defaults. Cursor block = new Cursor(SHAPE_BLOCK, 0, 0); ! Cursor ver25_input = new Cursor(SHAPE_VER, 25, -1); ! Cursor ver35_visual = new Cursor(SHAPE_VER, 35, 0); Cursor hor20 = new Cursor(SHAPE_HOR, 20, 0); Cursor hor50 = new Cursor(SHAPE_HOR, 50, 0); *************** *** 1075,1086 **** cursor_table[SHAPE_N] = block; cursor_table[SHAPE_V] = block; ! cursor_table[SHAPE_I] = ver25; cursor_table[SHAPE_R] = hor20; cursor_table[SHAPE_C] = block; ! cursor_table[SHAPE_CI] = ver25; cursor_table[SHAPE_CR] = hor20; cursor_table[SHAPE_SM] = block; // plus different blink rates cursor_table[SHAPE_O] = hor50; ! cursor_table[SHAPE_VE] = ver35; } --- 1075,1086 ---- cursor_table[SHAPE_N] = block; cursor_table[SHAPE_V] = block; ! cursor_table[SHAPE_I] = ver25_input; cursor_table[SHAPE_R] = hor20; cursor_table[SHAPE_C] = block; ! cursor_table[SHAPE_CI] = ver25_input; cursor_table[SHAPE_CR] = hor20; cursor_table[SHAPE_SM] = block; // plus different blink rates cursor_table[SHAPE_O] = hor50; ! cursor_table[SHAPE_VE] = ver35_visual; } |
|
From: Ernie R. <er...@us...> - 2010-01-28 03:55:15
|
Update of /cvsroot/jvi/jvi/src/com/raelity/jvi/swing In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv16642/swing Modified Files: OptionsPanel.java Log Message: - provide for enum/combo-box string/integer options. - various vis mode sel=exclusive issues Index: OptionsPanel.java =================================================================== RCS file: /cvsroot/jvi/jvi/src/com/raelity/jvi/swing/OptionsPanel.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OptionsPanel.java 1 Jan 2010 00:31:14 -0000 1.6 --- OptionsPanel.java 28 Jan 2010 03:55:07 -0000 1.7 *************** *** 29,32 **** --- 29,33 ---- import com.l2fprod.common.beans.ExtendedPropertyDescriptor; import com.l2fprod.common.beans.editor.AbstractPropertyEditor; + import com.l2fprod.common.beans.editor.ComboBoxPropertyEditor; import com.l2fprod.common.propertysheet.AbstractProperty; import com.l2fprod.common.propertysheet.Property; *************** *** 41,44 **** --- 42,47 ---- import com.l2fprod.common.swing.PercentLayout; import com.l2fprod.common.swing.renderer.ColorCellRenderer; + import com.raelity.jvi.EnumOption; + import com.raelity.jvi.Option; import com.raelity.jvi.Option.ColorOption; import com.raelity.jvi.Options; *************** *** 332,335 **** --- 335,346 ---- new ColorPropertyEditor(prop)); } + Option opt = Options.getOption(prop.getName()); + if(opt instanceof EnumOption) { + ComboBoxPropertyEditor pe = new ComboBoxPropertyEditor(); + pe.setAvailableValues( + ((EnumOption)opt).getAvailableValues()); + ((PropertyEditorRegistry)propertyEditors) + .registerEditor(prop, pe); + } properties[i2++] = prop; } |