- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 64 of file WikiEditor.java.
◆ WikiEditor()
org.turro.zkoss.text.WikiEditor.WikiEditor |
( |
| ) |
|
Definition at line 77 of file WikiEditor.java.
78 setSclass(
"wikiEditor");
79 Executions.createComponents(
"/WEB-INF/_zul/bs/comps/editor/wikiInput.zul",
this,
null);
80 Selectors.wireComponents(
this,
this,
false);
81 Selectors.wireEventListeners(
this,
this);
82 wikibox.setWidgetListener(
"onClick",
83 "zAu.send(new zk.Event(this,\"onCaret\",zk(this.$n()).getSelectionRange()+\"\",{toServer:true}));");
84 wikibox.setWidgetListener(
"onBlur",
85 "zAu.send(new zk.Event(this,\"onCaret\",zk(this.$n()).getSelectionRange()+\"\",{toServer:true}));");
86 wikibox.setWidgetListener(
"onSelection",
87 "zAu.send(new zk.Event(this,\"onCaret\",zk(this.$n()).getSelectionRange()+\"\",{toServer:true}));");
88 wikibox.setWidgetListener(
"onChanging",
89 "zAu.send(new zk.Event(this,\"onCaret\",zk(this.$n()).getSelectionRange()+\"\",{toServer:true}));");
90 wikibox.addEventListener(Events.ON_CHANGE,
new EventListener<InputEvent>() {
92 public void onEvent(InputEvent event) throws Exception {
93 Events.postEvent(WikiEditor.this, event);
◆ addResolver()
void org.turro.zkoss.text.WikiEditor.addResolver |
( |
IWikiResolver |
resolver | ) |
|
Definition at line 160 of file WikiEditor.java.
161 if(resolver !=
null) resolvers.add(resolver);
◆ getFileFolder()
String org.turro.zkoss.text.WikiEditor.getFileFolder |
( |
| ) |
|
◆ getHtml()
String org.turro.zkoss.text.WikiEditor.getHtml |
( |
| ) |
|
◆ getImageFolder()
String org.turro.zkoss.text.WikiEditor.getImageFolder |
( |
| ) |
|
◆ getValue()
String org.turro.zkoss.text.WikiEditor.getValue |
( |
| ) |
|
◆ isElWiki()
boolean org.turro.zkoss.text.WikiEditor.isElWiki |
( |
| ) |
|
◆ isNoTreeRepository()
boolean org.turro.zkoss.text.WikiEditor.isNoTreeRepository |
( |
| ) |
|
◆ isReadonly()
boolean org.turro.zkoss.text.WikiEditor.isReadonly |
( |
| ) |
|
◆ isReadOnlyRepository()
boolean org.turro.zkoss.text.WikiEditor.isReadOnlyRepository |
( |
| ) |
|
◆ onAlignCenter()
void org.turro.zkoss.text.WikiEditor.onAlignCenter |
( |
| ) |
|
◆ onAlignJustify()
void org.turro.zkoss.text.WikiEditor.onAlignJustify |
( |
| ) |
|
Definition at line 338 of file WikiEditor.java.
339 putAttribute(
"text-align",
"justify");
◆ onAlignLeft()
void org.turro.zkoss.text.WikiEditor.onAlignLeft |
( |
| ) |
|
◆ onAlignRight()
void org.turro.zkoss.text.WikiEditor.onAlignRight |
( |
| ) |
|
◆ onBackground()
void org.turro.zkoss.text.WikiEditor.onBackground |
( |
InputEvent |
event | ) |
|
Definition at line 408 of file WikiEditor.java.
409 putAttribute(
"background-color", event.getValue());
◆ onBlind()
void org.turro.zkoss.text.WikiEditor.onBlind |
( |
| ) |
|
Definition at line 230 of file WikiEditor.java.
231 insert(
"\n[blind(Caption1)]\n",
"Content1\n[blind(Caption2)]\nContent2\n[/blind]\n");
◆ onBlock()
void org.turro.zkoss.text.WikiEditor.onBlock |
( |
| ) |
|
Definition at line 200 of file WikiEditor.java.
201 insert(
"\n[block]\n",
"\n[/block]\n");
◆ onBold()
void org.turro.zkoss.text.WikiEditor.onBold |
( |
| ) |
|
Definition at line 235 of file WikiEditor.java.
236 WikiElement we =
new WikiElement(selectionStart, selectionEnd, wikibox, WikiElement.NON_BLOCK_ELEMENTS);
237 if(selectionStart == selectionEnd && we.inside() && !we.isTag(
"img")) {
238 putAttribute(
"font-weight",
"bold");
240 insert(
"**",
"**",
true);
◆ onCaret()
void org.turro.zkoss.text.WikiEditor.onCaret |
( |
Event |
event | ) |
|
Definition at line 165 of file WikiEditor.java.
166 String v[] = ((String) event.getData()).split(
",");
167 selectionStart = Integer.valueOf(v[0]);
168 selectionEnd = Integer.valueOf(v[1]);
◆ onColor()
void org.turro.zkoss.text.WikiEditor.onColor |
( |
InputEvent |
event | ) |
|
Definition at line 403 of file WikiEditor.java.
404 putAttribute(
"color", event.getValue());
◆ onElWiki()
void org.turro.zkoss.text.WikiEditor.onElWiki |
( |
| ) |
|
Definition at line 505 of file WikiEditor.java.
506 elwiki.setCheckmark(!elwiki.isCheckmark());
◆ onEndColumns()
void org.turro.zkoss.text.WikiEditor.onEndColumns |
( |
| ) |
|
◆ onEraser()
void org.turro.zkoss.text.WikiEditor.onEraser |
( |
| ) |
|
◆ onFloatLeft()
void org.turro.zkoss.text.WikiEditor.onFloatLeft |
( |
| ) |
|
◆ onFloatright()
void org.turro.zkoss.text.WikiEditor.onFloatright |
( |
| ) |
|
◆ onHeader1()
void org.turro.zkoss.text.WikiEditor.onHeader1 |
( |
| ) |
|
Definition at line 172 of file WikiEditor.java.
173 insertOnStartLine(
"---+",
new String[] {
174 "---++++",
"---+++",
"---++",
"---+"
◆ onHeader2()
void org.turro.zkoss.text.WikiEditor.onHeader2 |
( |
| ) |
|
Definition at line 179 of file WikiEditor.java.
180 insertOnStartLine(
"---++",
new String[] {
181 "---++++",
"---+++",
"---++",
"---+"
◆ onHeader3()
void org.turro.zkoss.text.WikiEditor.onHeader3 |
( |
| ) |
|
Definition at line 186 of file WikiEditor.java.
187 insertOnStartLine(
"---+++",
new String[] {
188 "---++++",
"---+++",
"---++",
"---+"
◆ onHeader4()
void org.turro.zkoss.text.WikiEditor.onHeader4 |
( |
| ) |
|
Definition at line 193 of file WikiEditor.java.
194 insertOnStartLine(
"---++++",
new String[] {
195 "---++++",
"---+++",
"---++",
"---+"
◆ onHtml()
void org.turro.zkoss.text.WikiEditor.onHtml |
( |
| ) |
|
Definition at line 279 of file WikiEditor.java.
281 div.setSclass(
"wikiEditor");
283 html.setSclass(
"wikiBox");
284 html.setReadonly(
true);
285 html.setMultiline(
true);
288 div.appendChild(html);
289 SelectionDialog.showComponent(getPage(),
"HTML", div,
"800px",
"80%",
null);
◆ onImage()
void org.turro.zkoss.text.WikiEditor.onImage |
( |
| ) |
|
Definition at line 437 of file WikiEditor.java.
438 WikiElement we =
new WikiElement(selectionStart, wikibox,
"img");
442 final RepositoryWalker repositories =
new RepositoryWalker(we);
443 repositories.selectFolder(imageFolder);
444 repositories.setFilter(RepositoryContent.IMAGE_FILTER);
445 repositories.setReadOnlyRepository(readOnlyRepository);
446 repositories.setNoTreeRepository(noTreeRepository);
447 SelectionDialog.showComponent(getPage(), I_.get(
"Repository"), repositories,
"90%",
"90%",
new Command() {
449 public Object execute(Context context) {
450 if(repositories.renderResult()) {
451 wikibox.setSelectionRange(selectionStart, selectionStart);
452 wikibox.setFocus(
true);
453 Events.postEvent(
new InputEvent(
"onChange",
WikiEditor.this, wikibox.
getValue(),
null));
◆ onItalic()
void org.turro.zkoss.text.WikiEditor.onItalic |
( |
| ) |
|
Definition at line 245 of file WikiEditor.java.
246 WikiElement we =
new WikiElement(selectionStart, selectionEnd, wikibox, WikiElement.NON_BLOCK_ELEMENTS);
247 if(selectionStart == selectionEnd && we.inside() && !we.isTag(
"img")) {
248 putAttribute(
"font-style",
"italic");
250 insert(
"__",
"__",
true);
◆ onLink()
void org.turro.zkoss.text.WikiEditor.onLink |
( |
| ) |
|
Definition at line 413 of file WikiEditor.java.
414 WikiElement we =
new WikiElement(selectionStart, selectionEnd, wikibox);
415 if(!we.isTag(
"link")) {
416 we.forgetAndCreate(
"link");
418 Link link =
new Link(we);
419 link.setFileFolder(fileFolder);
420 link.setReadOnlyRepository(readOnlyRepository);
421 link.setNoTreeRepository(noTreeRepository);
422 SelectionDialog.getComponent(Executions.getCurrent().getDesktop().getFirstPage(),
"Link", link,
"500px",
"300px",
new Command() {
424 public Object execute(Context context) {
425 Link link = (Link) context.get(
"component");
426 if(link !=
null && link.renderResult()) {
427 wikibox.setSelectionRange(selectionStart, selectionStart);
428 wikibox.setFocus(
true);
429 Events.postEvent(
new InputEvent(
"onChange",
WikiEditor.this, wikibox.
getValue(),
null));
◆ onNote()
void org.turro.zkoss.text.WikiEditor.onNote |
( |
| ) |
|
◆ onOlList()
void org.turro.zkoss.text.WikiEditor.onOlList |
( |
| ) |
|
◆ onPreview()
void org.turro.zkoss.text.WikiEditor.onPreview |
( |
| ) |
|
Definition at line 270 of file WikiEditor.java.
272 div.setStyle(
"overflow:auto;");
274 div.appendChild(html);
275 SelectionDialog.showComponent(getPage(), I_.get(
"Preview"), div,
"800px",
"80%",
null);
◆ onRegular()
void org.turro.zkoss.text.WikiEditor.onRegular |
( |
| ) |
|
◆ onSnippet()
void org.turro.zkoss.text.WikiEditor.onSnippet |
( |
| ) |
|
Definition at line 483 of file WikiEditor.java.
484 File wsnip =
new File(ElephantContext.getRealPath(
"/WEB-INF/elephant/wiki/snippets"));
486 FileListbox fl =
new FileListbox();
488 fl.setFilter(
".*\\.wiki");
490 fl.addEventListener(Events.ON_DOUBLE_CLICK, (Event event) -> {
491 insert(FileUtil.getContentWithLineBreaks(fl.getObjectValue()));
492 Events.postEvent(new Event(Events.ON_CLOSE, Components.from(fl).parent(SelectionDialog.class)));
494 SelectionDialog.showComponent(getPage(), I_.get(
"Repository"), fl,
"300px",
"50%", (Context context) -> {
495 if(fl.getObjectValue() != null) {
496 wikibox.setFocus(true);
497 Events.postEvent(new InputEvent(
"onChange", WikiEditor.this, wikibox.getValue(), null));
◆ onSpan()
void org.turro.zkoss.text.WikiEditor.onSpan |
( |
| ) |
|
◆ onStartColumn()
void org.turro.zkoss.text.WikiEditor.onStartColumn |
( |
| ) |
|
◆ onStartJava()
void org.turro.zkoss.text.WikiEditor.onStartJava |
( |
| ) |
|
◆ onStartWiki()
void org.turro.zkoss.text.WikiEditor.onStartWiki |
( |
| ) |
|
◆ onStartXml()
void org.turro.zkoss.text.WikiEditor.onStartXml |
( |
| ) |
|
◆ onStopJava()
void org.turro.zkoss.text.WikiEditor.onStopJava |
( |
| ) |
|
◆ onStopWiki()
void org.turro.zkoss.text.WikiEditor.onStopWiki |
( |
| ) |
|
◆ onStopXml()
void org.turro.zkoss.text.WikiEditor.onStopXml |
( |
| ) |
|
◆ onTabulator()
void org.turro.zkoss.text.WikiEditor.onTabulator |
( |
| ) |
|
Definition at line 225 of file WikiEditor.java.
226 insert(
"\n[tab(Caption1)]\n",
"Content1\n[tab(Caption2)]\nContent2\n[/tab]\n");
◆ onTcl()
void org.turro.zkoss.text.WikiEditor.onTcl |
( |
| ) |
|
◆ onTcr()
void org.turro.zkoss.text.WikiEditor.onTcr |
( |
| ) |
|
◆ onTemplate()
void org.turro.zkoss.text.WikiEditor.onTemplate |
( |
| ) |
|
Definition at line 461 of file WikiEditor.java.
462 File wtmpl =
new File(ElephantContext.getRealPath(
"/WEB-INF/elephant/wiki/templates"));
464 FileListbox fl =
new FileListbox();
466 fl.setFilter(
".*\\.wiki");
468 fl.addEventListener(Events.ON_DOUBLE_CLICK, (Event event) -> {
469 insert(FileUtil.getContentWithLineBreaks(fl.getObjectValue()));
470 Events.postEvent(new Event(Events.ON_CLOSE, Components.from(fl).parent(SelectionDialog.class)));
472 SelectionDialog.showComponent(getPage(), I_.get(
"Repository"), fl,
"300px",
"50%", (Context context) -> {
473 if(fl.getObjectValue() != null) {
474 wikibox.setFocus(true);
475 Events.postEvent(new InputEvent(
"onChange", WikiEditor.this, wikibox.getValue(), null));
◆ onTet()
void org.turro.zkoss.text.WikiEditor.onTet |
( |
| ) |
|
◆ onThl()
void org.turro.zkoss.text.WikiEditor.onThl |
( |
| ) |
|
◆ onThr()
void org.turro.zkoss.text.WikiEditor.onThr |
( |
| ) |
|
◆ onToWiki()
void org.turro.zkoss.text.WikiEditor.onToWiki |
( |
| ) |
|
Definition at line 260 of file WikiEditor.java.
262 String w = Parser.toWiki(v);
263 wikibox.setSelectedText(0, v.length(), w,
false);
264 wikibox.setSelectionRange(0, 0);
265 wikibox.setFocus(
true);
266 Events.postEvent(
new InputEvent(
"onChange",
this, wikibox.
getValue(),
null));
◆ onTrl()
void org.turro.zkoss.text.WikiEditor.onTrl |
( |
| ) |
|
◆ onTrr()
void org.turro.zkoss.text.WikiEditor.onTrr |
( |
| ) |
|
◆ onUlList()
void org.turro.zkoss.text.WikiEditor.onUlList |
( |
| ) |
|
◆ setFileFolder()
void org.turro.zkoss.text.WikiEditor.setFileFolder |
( |
String |
folder | ) |
|
◆ setImageFolder()
void org.turro.zkoss.text.WikiEditor.setImageFolder |
( |
String |
folder | ) |
|
◆ setNoTreeRepository()
void org.turro.zkoss.text.WikiEditor.setNoTreeRepository |
( |
boolean |
noTreeRepository | ) |
|
Definition at line 152 of file WikiEditor.java.
153 this.noTreeRepository = noTreeRepository;
◆ setReadonly()
void org.turro.zkoss.text.WikiEditor.setReadonly |
( |
boolean |
value | ) |
|
Definition at line 131 of file WikiEditor.java.
132 wikibox.setReadonly(value);
133 for(Object obj : wikibar.getChildren()) {
134 if(obj instanceof Menuitem) {
135 ((Menuitem) obj).setDisabled(value);
◆ setReadOnlyRepository()
void org.turro.zkoss.text.WikiEditor.setReadOnlyRepository |
( |
boolean |
readOnlyRepository | ) |
|
Definition at line 144 of file WikiEditor.java.
145 this.readOnlyRepository = readOnlyRepository;
◆ setValue()
void org.turro.zkoss.text.WikiEditor.setValue |
( |
String |
value | ) |
|
Definition at line 98 of file WikiEditor.java.
100 elwiki.setCheckmark(WikiParser.isElWiki(value));
The documentation for this class was generated from the following file: