jEdit Community - Resources for users of the jEdit Text Editor
Plugin Console: TOGGLE LABEL is not working properly
Submitted by domingo80 on Thursday, 15 November, 2007 - 23:42

Hello guys,

I'm having some problems making an XML file for a commando UserInterface with the console plugin.
The jedit help is telling about the use of the TOGGLE_ENTRY ELEMENT the following:

Here is an example TOGGLE_ENTRY element:
<TOGGLE_ENTRY LABEL="Additional file" VARNAME="ignoreCase"
EVAL="buffer.getPath()"/>


Now, i've try this:

<?xml version="1.0"?>

<!DOCTYPE COMMANDO SYSTEM "commando.dtd">

<COMMANDO>
<TOGGLE LABEL="blahblah"
VARNAME="var1" />
<TOGGLE_ENTRY LABEL="more blah " VARNAME="var2"
EVAL="buffer.getPath()"/>
</COMMANDO>

The first action "toggle" is working, which means for me that the xml file (under \.jedit\console\commando) has been found and could be read. Now, if i add the element "toggle_entry" jedit is giving an error. Im having exactly the same problem with the LONG ENTRY element!
Am i doing something really wrong or is this a bug? This feature is really important for me, so if u guys have an idea, plz let me know it!

The first lines of the BeanShell error say:

Sourced file: inline evaluation of: ``commandoTOGGLE_ENTRY(view,pane,ns,label,var,options);'' : Undefined argument: value : at Line: 10 : in file: commandoTOGGLE_ENTRY : ( value )

Called from method: commandoTOGGLE_ENTRY : at Line: 1 : in file: inline evaluation of: ``commandoTOGGLE_ENTRY(view,pane,ns,label,var,options);'' : commandoTOGGLE_ENTRY ( view , pane , ns , label , var , options )
at bsh.BSHArguments.getArguments(BSHArguments.java:67)
at bsh.BSHPrimarySuffix.doName(BSHPrimarySuffix.java:167)
.....

...
.

Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
buffer not available for commandos.
by elberry on Fri, 16/11/2007 - 16:46
I had the same problem before, I don't think that the buffer variable is available in commando. If you want to get the path of the current buffer, you should use the fully qualified jEdit class, and getActiveView -> getBuffer -> getPath.

Like this:
[code]
<TOGGLE_ENTRY LABEL="more blah " VARNAME="var2"
EVAL="org.gjt.sp.jedit.jEdit.getActiveView().getBuffer().getPath()"/>
[/code]

Try that.
Eric

Learn from the past. Live in the present. Plan for the future.
User login
Browse archives
« March 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82338
Context Free Art (*.cfdg)   0.31   46042
JBuilder scheme   .001   18486
BBEdit scheme   1.0   18107
ColdFusion scheme   1.0   18015
R Edit Mode - extensive version   0.1   17461
Advanced HTML edit mode   1.0   16194
Matlab Edit Mode   1.0   16056
jEdit XP icons   1.0   15220
XP icons for jEdit   1.1   14281