equal
deleted
inserted
replaced
34 private TextModifyListener modListener = new TextModifyListener(); |
34 private TextModifyListener modListener = new TextModifyListener(); |
35 |
35 |
36 private TextWrapper textWrapper; |
36 private TextWrapper textWrapper; |
37 |
37 |
38 private int numLines; |
38 private int numLines; |
|
39 private Shell topShell; |
|
40 private boolean firstDisplayable = false; |
39 |
41 |
40 /** |
42 /** |
41 * Constructor. |
43 * Constructor. |
42 * |
44 * |
43 * @param title - Title of the TextBox |
45 * @param title - Title of the TextBox |
57 * |
59 * |
58 * @return custom eSWT dialog shell |
60 * @return custom eSWT dialog shell |
59 */ |
61 */ |
60 Shell eswtConstructShell(int style) |
62 Shell eswtConstructShell(int style) |
61 { |
63 { |
62 Shell topShell = super.eswtConstructShell(style); |
64 topShell = super.eswtConstructShell(style); |
63 // TextBox with null title and ANY constraint, should be Full-Screen |
65 Shell currentShell = topShell; |
64 if(getTitle() == null && TextWrapper.getTypeConstraint( |
66 if(super.isPopup()) |
65 textWrapper.getConstraints()) == TextField.ANY) |
67 { |
66 { |
68 currentShell = new Shell(topShell, style | SWT.DIALOG_TRIM | SWT.RESIZE); |
67 return topShell; |
69 } |
68 } |
70 return currentShell; |
69 else |
|
70 { |
|
71 if(JadAttributeUtil.isValue(JadAttributeUtil.ATTRIB_NOKIA_UI_ENHANCEMENT, JadAttributeUtil.VALUE_FULLSCREEN_TEXTBOX)) |
|
72 { |
|
73 return topShell; |
|
74 } |
|
75 else |
|
76 { |
|
77 return new Shell(topShell, style | SWT.DIALOG_TRIM | SWT.RESIZE); |
|
78 } |
|
79 } |
|
80 } |
71 } |
81 |
72 |
82 /* (non-Javadoc) |
73 /* (non-Javadoc) |
83 * @see Displayable#eswtConstructContent(int) |
74 * @see Displayable#eswtConstructContent(int) |
84 */ |
75 */ |
92 /* (non-Javadoc) |
83 /* (non-Javadoc) |
93 * @see Displayable#eswtHandleShowCurrentEvent() |
84 * @see Displayable#eswtHandleShowCurrentEvent() |
94 */ |
85 */ |
95 void eswtHandleShowCurrentEvent() |
86 void eswtHandleShowCurrentEvent() |
96 { |
87 { |
|
88 // If it is popuptextbox and there is no active displayable |
|
89 // behind textbox default displayable should be shown |
|
90 if(super.isPopup() && topShell != null && |
|
91 topShell.isVisible() == false && firstDisplayable == true) |
|
92 { |
|
93 topShell.setVisible(true); |
|
94 } |
97 super.eswtHandleShowCurrentEvent(); |
95 super.eswtHandleShowCurrentEvent(); |
98 textWrapper.setModifyListener(modListener); |
96 textWrapper.setModifyListener(modListener); |
99 eswtSetPreferredContentSize(-1, textWrapper |
97 eswtSetPreferredContentSize(-1, textWrapper |
100 .getPreferredHeight(Config.TEXTBOX_MAX_VISIBLE_LINES)); |
98 .getPreferredHeight(Config.TEXTBOX_MAX_VISIBLE_LINES)); |
101 } |
99 } |
114 */ |
112 */ |
115 void eswtHandleResizeEvent(int width, int height) |
113 void eswtHandleResizeEvent(int width, int height) |
116 { |
114 { |
117 super.eswtHandleResizeEvent(width, height); |
115 super.eswtHandleResizeEvent(width, height); |
118 textWrapper.setBounds(getContentComp().getClientArea()); |
116 textWrapper.setBounds(getContentComp().getClientArea()); |
|
117 } |
|
118 |
|
119 /* (non-Javadoc) |
|
120 */ |
|
121 void setFirstDisplayable(boolean first) |
|
122 { |
|
123 firstDisplayable = first; |
119 } |
124 } |
120 |
125 |
121 /** |
126 /** |
122 * Get current caret position. |
127 * Get current caret position. |
123 * |
128 * |