Anonymous avatar Anonymous committed 3cf0b61

added accessors to EditField

Comments (0)

Files changed (1)

src/main/scala/twlext/EditField.scala

 package twlext
 import de.matthiasmann.twlscala.twlinternal.ThemeSupport
 import de.matthiasmann.twlscala.Publisher
-
 import de.matthiasmann.twl.{ EditField => TWLEditField }
+import de.matthiasmann.twl.model.StringModel
+import de.matthiasmann.twl.model.StringAttributes
+import de.matthiasmann.twl.EditFieldAutoCompletionWindow
+import de.matthiasmann.twl.renderer.Font
 
 case class EditFieldChanged(field: EditField, key: Int)
 
-
 class EditField extends TWLEditField with Publisher with ThemeSupport { self =>
   addCallback(new TWLEditField.Callback {
     def callback(key: Int) {
       publish(EditFieldChanged(self, key))
     }
   })
+
+  def forwardUnhandledKeysToCallback: Boolean = isForwardUnhandledKeysToCallback
+  def forwardUnhandledKeysToCallback_=(b: Boolean) = setForwardUnhandledKeysToCallback(b)
+
+  def autoCompletionOnSetText: Boolean = isAutoCompletionOnSetText
+  def autoCompletionOnSetText_=(b: Boolean) = setAutoCompletionOnSetText(b)
+
+  // can't call this "scrollToCursorOnSizeChange" because the field 
+  // of the same name is not private
+  // def scrollToCursorOnSizeChange : Boolean = isScrollToCursorOnSizeChange
+  // def scrollToCursorOnSizeChange_=(b:Boolean) = setScrollToCursorOnSizeChange(b)
+  def sizeChangeScrollsCursor: Boolean = isScrollToCursorOnSizeChange
+  def sizeChangeScrollsCursor_=(b: Boolean) = setScrollToCursorOnSizeChange(b)
+
+  def passwordMasking: Boolean = isPasswordMasking
+  def passwordMasking_=(b: Boolean) = setPasswordMasking(b)
+
+  def passwordChar: Char = getPasswordChar
+  def passwordChar_(c: Char) = setPasswordChar(c)
+
+  def columns: Int = getColumns
+  def columns_=(i: Int) = setColumns(i)
+
+  // Same problem as scrollToCursorOnSizeChange, conflicts with a field.
+  // Renaming this one is annoying, but I went for the case change
+  //  def multiLine: Boolean = isMultiLine
+  //  def multiLine_=(b: Boolean) = setMultiLine(b)
+  def multiline: Boolean = isMultiLine
+  def multiline_=(b: Boolean) = setMultiLine(b)
+
+  def model: StringModel = getModel
+  def model_=(m: StringModel) = setModel(m)
+
+  def text: String = getText
+  def text_=(t: String) = setText(t)
+
+  def stringAttributes: StringAttributes = getStringAttributes
+
+  def selectedText: String = getSelectedText
+
+  def cursorPos : Int = getCursorPos
+  def textLength : Int = getTextLength
+  
+  def readOnly : Boolean = isReadOnly
+  def readOnly_=(b:Boolean) = setReadOnly(b)
+
+  def maxTextLength : Int = getMaxTextLength
+  def maxTextLength_=(i:Int) = setMaxTextLength(i)
+
+  // These four really should be on a trait
+  def minWidth: Int = getMinWidth
+  def minHeight: Int = getMinHeight
+  def preferredInnerWidth : Int = getPreferredInnerWidth
+  def preferredInnerHeight : Int = getPreferredInnerHeight
+
+  // Maybe this one too?
+  def toolTipContent : AnyRef = getTooltipContent
+
+  def autoCompletionWindow: EditFieldAutoCompletionWindow = getAutoCompletionWindow
+  def autoCompletionWindow_=(w:EditFieldAutoCompletionWindow) = setAutoCompletionWindow(w)
 }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.