--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorImpl.java Wed Jun 09 09:34:07 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorImpl.java Mon Jun 21 15:32:50 2010 +0300
@@ -10,7 +10,7 @@
*
* Contributors:
*
- * Description: Package private class implementing the S60 interfaces
+ * Description: Package private class implementing the S60 interfaces
* for TextEditor
*
*/
@@ -34,8 +34,9 @@
* @since 1.4
*/
class TextEditorImpl
- extends com.nokia.mid.ui.TextEditor
- implements com.nokia.mid.ui.S60TextEditor {
+ extends com.nokia.mid.ui.TextEditor
+ implements com.nokia.mid.ui.S60TextEditor
+{
/*
* Indicates that all input methods are available.
* <p>
@@ -128,7 +129,8 @@
* if the width or height is less than one pixel
*/
TextEditorImpl(String aText, int aMaxSize, int aConstraints, int aWidth,
- int aHeight) {
+ int aHeight)
+ {
super(aText, aMaxSize, aConstraints, aWidth, aHeight, false);
}
@@ -171,10 +173,11 @@
* @throws IllegalArgumentException
* if the width is less than one pixel
*/
- TextEditorImpl(int aMaxSize, int aConstraints, int aWidth, int aRows) {
+ TextEditorImpl(int aMaxSize, int aConstraints, int aWidth, int aRows)
+ {
super(null, aMaxSize, aConstraints, aWidth, aRows, true);
}
-
+
/*
* Set the parent object of this TextEditor. Typically in LCDUI the parent
* object would be Canvas or CustomItem. Setting the parameter to null
@@ -186,10 +189,12 @@
* if <code>aParent</code> is not a valid object with which a
* TextEditor can be associated
*/
- public void setParent( Object aParent ) {
- super.setParent( aParent );
+ public void setParent(Object aParent)
+ {
+ super.setParent(aParent);
// Update indicator location to their default position.
- if( aParent != null ) {
+ if (aParent != null)
+ {
setDefaultIndicators();
}
}
@@ -228,10 +233,12 @@
* the y coordinate of the anchor point, in pixels.
*
*/
- public void setIndicatorLocation(int x, int y) {
- synchronized (iToolkit) {
+ public void setIndicatorLocation(int x, int y)
+ {
+ synchronized (iToolkit)
+ {
NativeError.check(_setIndicatorLocation(getToolkitHandle(),
- iHandle, x, y));
+ iHandle, x, y));
}
}
@@ -260,17 +267,20 @@
* If the <code>TextEditor</code> is not added to
* <code>Canvas</code>
*/
- public void setDefaultIndicators() {
- synchronized (iToolkit) {
+ public void setDefaultIndicators()
+ {
+ synchronized (iToolkit)
+ {
Object parent = getParent();
boolean fullScreen = false;
- if (parent instanceof Canvas) {
+ if (parent instanceof Canvas)
+ {
fullScreen = iLCDUIPackageInvoker.isFullScreen((Canvas) parent);
}
NativeError.check(_setDefaultIndicators(getToolkitHandle(),
- iHandle, fullScreen));
+ iHandle, fullScreen));
}
}
@@ -294,10 +304,12 @@
* @see #setIndicatorLocation(int, int)
* @see #setDefaultIndicators()
*/
- public void setIndicatorVisibility(boolean visible) {
- synchronized (iToolkit) {
+ public void setIndicatorVisibility(boolean visible)
+ {
+ synchronized (iToolkit)
+ {
NativeError.check(_setIndicatorVisibility(getToolkitHandle(),
- iHandle, visible));
+ iHandle, visible));
}
}
@@ -317,12 +329,14 @@
* @return the width and height of area needed for drawing input indicators
* @see #setDefaultIndicators()
*/
- public int[] getIndicatorSize() {
+ public int[] getIndicatorSize()
+ {
int[] size = new int[INDICATOR_SIZE_COUNT];
- synchronized (iToolkit) {
+ synchronized (iToolkit)
+ {
NativeError.check(_getIndicatorSize(getToolkitHandle(), iHandle,
- size));
+ size));
}
return size;
}
@@ -349,17 +363,20 @@
* @see #setPreferredTouchMode(int)
* @see #getDisabledTouchInputModes()
*/
- public void setDisabledTouchInputModes(int touchInputModes) {
+ public void setDisabledTouchInputModes(int touchInputModes)
+ {
// Validate touch input modes. There must not be additional modes
// 0 is valid.
// See com.nokia.mid.ui.s60.TextEditor.TOUCH_INPUT_ALL_AVAILABLE.
- if ((touchInputModes & ~MASK) != 0) {
+ if ((touchInputModes & ~MASK) != 0)
+ {
throw new IllegalArgumentException();
}
- synchronized (iToolkit) {
+ synchronized (iToolkit)
+ {
NativeError.check(_setDisabledTouchInputModes(getToolkitHandle(),
- iHandle, touchInputModes));
+ iHandle, touchInputModes));
}
}
@@ -378,10 +395,12 @@
* @see #setDisabledTouchInputModes(int)
* @see #setPreferredTouchMode(int)
*/
- public int getDisabledTouchInputModes() {
+ public int getDisabledTouchInputModes()
+ {
int disabled = 0;
- synchronized (iToolkit) {
+ synchronized (iToolkit)
+ {
disabled = _getDisabledTouchInputModes(getToolkitHandle(), iHandle);
}
@@ -410,17 +429,20 @@
* @see #getPreferredTouchMode()
*
*/
- public void setPreferredTouchMode(int touchInputModes) {
+ public void setPreferredTouchMode(int touchInputModes)
+ {
int mask = touchInputModes & MASK;
// Validate touch input mode.
if (touchInputModes == 0 || (touchInputModes & ~MASK) != 0
- || (mask & (mask - 1)) != 0) {
+ || (mask & (mask - 1)) != 0)
+ {
throw new IllegalArgumentException();
}
- synchronized (iToolkit) {
+ synchronized (iToolkit)
+ {
NativeError.check(_setPreferredTouchMode(getToolkitHandle(),
- iHandle, touchInputModes));
+ iHandle, touchInputModes));
}
}
@@ -436,37 +458,42 @@
* @see #setPreferredTouchMode(int)
* @see #setDisabledTouchInputModes(int)
*/
- public int getPreferredTouchMode() {
+ public int getPreferredTouchMode()
+ {
int preferredMode = 0;
- synchronized (iToolkit) {
+ synchronized (iToolkit)
+ {
preferredMode = _getPreferredTouchMode(getToolkitHandle(), iHandle);
}
NativeError.check(preferredMode);
return preferredMode;
}
-
+
/*
* Sets the caret in the Editor at x, y location.
- *
+ *
* @param x
* The x coordinate of the wanted caret position.
*
* @param y
* The y coordinate of the wanted caret position.
*/
- public void setCaretXY(int x, int y) {
- synchronized (iToolkit) {
+ public void setCaretXY(int x, int y)
+ {
+ synchronized (iToolkit)
+ {
NativeError.check(_setCaretXY(getToolkitHandle(),
- iHandle, x, y));
+ iHandle, x, y));
}
}
/*
* Hidden default constructor.
*/
- private TextEditorImpl() {
+ private TextEditorImpl()
+ {
}
// Private methods.