org.acm.seguin.ide.kawa
Class KawaPrettyPrint

java.lang.Object
  extended by org.acm.seguin.pretty.PrettyPrintFile
      extended by org.acm.seguin.pretty.PrettyPrintString
          extended by org.acm.seguin.pretty.PrettyPrintFromIDE
              extended by org.acm.seguin.ide.kawa.KawaPrettyPrint

public class KawaPrettyPrint
extends PrettyPrintFromIDE

This plugin is for Kawa 5 and will not work on previous versions though it will be fairly easy to port. I decided to write this plugin since I used to write my code in Kawa and then reopen it with the slow java editor jEdit just to add code comments. So one night I spend some minutes in creating this simple plugin and now I have pretty print feature in my Kawa - thanks to folks who created jrefactory (http://jrefactory.sf.net/).

Instructions for installation:

Since:
2.6.32
Author:
Valentin Valchev

Constructor Summary
KawaPrettyPrint(boolean install)
          Constructor for the KawaPrettyPrint object
 
Method Summary
protected  int getLineNumber()
          Returns the number of current line - Kawa does not support this - but I do!! Yes! This works now almost perfectly ;)
protected  java.lang.String getStringFromIDE()
          Called prom parrent class this method should return contents of buffer
static void main(java.lang.String[] args)
          The main program for the KawaPrettyPrint class
 void onEvent(KawaEvent event)
          This method is implementation of KawaEventListener, onEvent().
protected  void setLineNumber(int value)
          This method is called from parent.
protected  void setStringInIDE(java.lang.String value)
          Again method called from within parent class.
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintFromIDE
getPrintData, prettyPrintCurrentWindow
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintString
getOutputBuffer, getWriter, resetOutputBuffer, setInputString
 
Methods inherited from class org.acm.seguin.pretty.PrettyPrintFile
apply, apply, getParserFactory, isApplicable, postApply, setAsk, setParserFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KawaPrettyPrint

public KawaPrettyPrint(boolean install)
Constructor for the KawaPrettyPrint object

Parameters:
install - Has this been installed?
Since:
2.6.32
Method Detail

setLineNumber

protected void setLineNumber(int value)
This method is called from parent. Unfortunately Kawa does not support getting current line number and that's why setting current line number is useless.

Specified by:
setLineNumber in class PrettyPrintFromIDE
Parameters:
value - The new line number
Since:
2.6.32

setStringInIDE

protected void setStringInIDE(java.lang.String value)
Again method called from within parent class. When called buffer contents should be replaced with text contained within value parameter

Specified by:
setStringInIDE in class PrettyPrintFromIDE
Parameters:
value - the new contents of current buffer
Since:
2.6.32

getLineNumber

protected int getLineNumber()
Returns the number of current line - Kawa does not support this - but I do!! Yes! This works now almost perfectly ;)

Specified by:
getLineNumber in class PrettyPrintFromIDE
Returns:
current line number
Since:
2.6.32

getStringFromIDE

protected java.lang.String getStringFromIDE()
Called prom parrent class this method should return contents of buffer

Specified by:
getStringFromIDE in class PrettyPrintFromIDE
Returns:
contents of file which is going to be saved.
Since:
2.6.32

main

public static void main(java.lang.String[] args)
The main program for the KawaPrettyPrint class

Parameters:
args - The command line arguments
Since:
2.6.32

onEvent

public void onEvent(KawaEvent event)
This method is implementation of KawaEventListener, onEvent(). It is called by Kawa upon incoming events. KawaEventListener is installed on KawaFile and this method is called upon KawaFileEvent.

Parameters:
event - KawaEvent
Since:
2.6.32