Skip to content

Commit 25e7969

Browse files
author
Robert Virkus
committed
improved documentation
1 parent 0839435 commit 25e7969

File tree

8 files changed

+138
-3
lines changed

8 files changed

+138
-3
lines changed

enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*
77
* @author Robert Virkus, [email protected]
88
* @see UniformItemSource
9+
* @see UniformContainer
10+
* @see SourcedContainer
11+
* @see SourcedLazyContainer
912
*/
1013
public interface ItemSource
1114
{

enough-polish-sample-messaging/resources/base/style/polish.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,21 @@ info {
178178
layout: vertical-center;
179179
}
180180

181+
.messageFromMe:hover
182+
{
183+
background-color: #fcc;
184+
}
185+
181186
.messageFromUser extends messageFromMe {
182187
background-color: red;
183188
}
184189

190+
.messageFromUser:hover
191+
{
192+
background-color: #fcc;
193+
}
194+
195+
185196
.simpleMessage {
186197
text-effect: smiley-extended;
187198
label-style: nameLabel;
@@ -198,12 +209,22 @@ info {
198209
background-color: silver;
199210
}
200211

212+
.simpleMessageFromMe:hover
213+
{
214+
background-color: #cfc;
215+
}
216+
201217
.simpleMessageFromYou extends simpleMessage
202218
{
203219
layout: right;
204220
background-color: #faa;
205221
}
206222

223+
.simpleMessageFromYou:hover
224+
{
225+
background-color: #cfc;
226+
}
227+
207228
/********************* CONTACT FORM ******************************************************************************************************/
208229

209230
.contactList {

enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
public class SimpleMessageForm extends FramedForm {
4848

4949
TextField inputField;
50-
private ArrayList messageList = new ArrayList();
5150
private MessageItemSource itemSource;
5251

5352
/**
@@ -118,6 +117,7 @@ public Item createItem(int index) {
118117
//#style simpleMessageFromYou
119118
item = new StringItem(message.getSender() + ":", text);
120119
};
120+
//item.setDefaultCommand( new Command("Resend", Command.ITEM, 2));
121121
return item;
122122
}
123123

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<%define inDocumentationSection %>
2+
<%define inDocumentationSection.gui %>
3+
<%set title = J2ME Polish: Item %>
4+
<%set basedir = ../ %>
5+
<%include start_syntax.txt %>
6+
7+
<h1 id="top">Container</h1>
8+
<ul class="relatedtechnologies">
9+
<li class="relatedtechnologiesheader">Related Topics:</li>
10+
<li><a href="gui-item-tableitem.html">TableItem</a></li>
11+
<li><a href="gui-item-treeitem.html">TreeItem</a></li>
12+
</ul>
13+
<%index %>
14+
15+
<p>
16+
<img src="<%= basedir%>images/gui-item-container.png" width="175" height="220" alt="Container can hold many items" />
17+
18+
Container contain different items. They are the basis for all J2ME Polish screens like
19+
<a href="gui-screen-form.html">Form</a>, <a href="gui-screen-framedform.html">FramedForm</a>
20+
or <a href="gui-screen-list.html">List</a>.
21+
<br/>
22+
You can create arbitrary complex items by nesting containers into each other.
23+
<br />
24+
You can also use columns and rows for containers or use any of the <a href="gui-visualguide-viewtypes.html#gui-viewtypes-container">view-type</a>s
25+
available for Containers.
26+
</p>
27+
28+
<h2 id="Container-ItemSource">ItemSource</h2>
29+
<p>
30+
The following containers require an item source. An <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/ItemSource.html">de.enough.polish.ui.ItemSource</a>
31+
is responsible for translating underlying data into UI items. When an ItemSource is used, an
32+
<a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/ItemConsumer.html">de.enough.polish.ui.ItemConsumer</a> will register
33+
with the source, so that the ItemSource can inform the ItemConsumer when the underlying data has been updated.
34+
</p>
35+
36+
<h2 id="Container-UsingADifferentContainer">Using a Different Container</h2>
37+
<p>
38+
If you want to use a different container you can either use one of the provided convenience forms
39+
such as <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/UniformForm.html">UniformForm</a>
40+
or <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/SourcedForm.html">SourcedForm</a>
41+
or you register the container as a root container using <code>Screen.setRootContainer(Container)</code>:
42+
</p>
43+
<pre class="brush: java">
44+
public class MyFramedForm extends FramedForm
45+
{
46+
public MyFramedForm()
47+
{
48+
super("title");
49+
ItemSource mySource = new MyItemSource();
50+
SourcedLazyContainer container = new SourcedLazyContainer(mySource, 5, 15);
51+
setRootContainer(container);
52+
}
53+
}
54+
</pre>
55+
56+
<h2 id="Container-SourcedContainer">SourcedContainer</h2>
57+
<p>
58+
A <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/SourcedContainer.html">de.enough.polish.ui.SourcedContainer</a>
59+
is a normal container that uses an ItemSource.
60+
</p>
61+
62+
<h2 id="Container-SourcedLazyContainer">SourcedLazyContainer</h2>
63+
<p>
64+
The <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/SourcedLazyContainer.html">de.enough.polish.ui.SourcedLazyContainer</a>
65+
only loads items when they are required. In contrast to the UniformContainer those Items can vary in height,
66+
a typical example include messages or news entries.
67+
<br/>
68+
In combination with data storage like <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/io/ChunkedStorageCollection.html">de.enough.polish.io.ChunkedStorageCollection</a>,
69+
<a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/io/ChunkedStorageRmsSystem.html">de.enough.polish.io.ChunkedStorageRmsSystem</a>
70+
and the like you can create endless scrolling screens.
71+
</p>
72+
73+
<h2 id="Container-UniformContainer">UniformContainer</h2>
74+
<p>
75+
The <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/UniformContainer.html">de.enough.polish.ui.UniformContainer</a>
76+
along with the convenience <a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/UniformForm.html">de.enough.polish.ui.UniformForm</a>
77+
allow you to show vast numbers of entries without using too much memory.
78+
<br/>
79+
For best memory efficiency the UniformContainer reuses items - for doing that you need to supply a
80+
<a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/UniformItemSource.html">de.enough.polish.ui.UniformItemSource</a>
81+
instead of an ItemSource. The UniformItemSource additionally defines a <code>void populateItem(int itemIndex, Item item )</code>
82+
method for reusing items.
83+
<br/>
84+
A UniformContainer only supports items that have the same height.
85+
</p>
86+
87+
<h2 id="Item-SampleApp">Sample App</h2>
88+
<p>
89+
Please compare the 'messaging' sample application for using ItemSource, UniformContainer and SourcedLazyContainer.
90+
</p>
91+
92+
<h2 id="Item-JavaDoc">JavaDoc</h2>
93+
<ul>
94+
<li><a href="<%= javadocdir %>/javadoc/j2me/de/enough/polish/ui/Container.html">de.enough.polish.ui.Container</a></li>
95+
</ul>
96+
97+
<%include end.txt %>

enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ <h3 id="gui-viewtypes-item-size-increase">size-increase view-type</h3>
136136

137137
<h2 id="gui-viewtypes-container">View Types for Container based UI Components</h2>
138138
<p>
139-
You can apply the following <code>view-type</code>s for all Container based UI components - basically these are all
140-
components that can contain a number of items. Examples include <a href="gui-item-choicegroup.html">ChoiceGroup</a>,
139+
You can apply the following <code>view-type</code>s for all <a href="gui-item-container.html">Container</a>
140+
based UI components - basically these are all components that can contain a number of items.
141+
Examples include <a href="gui-item-choicegroup.html">ChoiceGroup</a>,
141142
<a href="gui-screen-list.html">List</a>, <a href="gui-screen-form.html">Form</a>, <a href="gui-item-htmlbrowser.html">HtmlBrowser</a>
142143
and <a href="gui-screenelement-menubar.html">commands menu</a>.
143144
</p>

enough-polish-website/site/source/docs/gui-visualguide.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ <h3 id="gui-item-clockitem">ClockItem</h3>
276276
<td valign="center">The <a href="gui-item-clockitem.html">ClockItem</a> displays the time.</td>
277277
</tr></table>
278278

279+
<h3 id="gui-item-container">Container</h3>
280+
<table><tr>
281+
<td><a href="gui-item-container.html"><img src="<%= basedir%>images/gui-item-container.png" width="175" height="220" alt="Container can hold many items" /></a></td>
282+
<td valign="center">Different <a href="gui-item-container.html">container</a> implementations allow you to show an insane amount of data in one screen.</td>
283+
</tr></table>
284+
279285
<h3 id="gui-item-custom">CustomItem</h3>
280286
<table><tr>
281287
<td><a href="gui-item-customitem.html"><img src="<%= basedir%>images/extend.png" width="76" height="68" alt="Create Your Own CustomItem" /></a></td>
@@ -419,5 +425,7 @@ <h3 id="gui-item-treeitem">TreeItem</h3>
419425
</a></td>
420426
<td valign="center">Interact with hierarchical data with the <a href="gui-item-treeitem.html">TreeItem</a>.</td>
421427
</tr></table>
428+
429+
422430

423431
<%include end.txt %>
7.24 KB
Loading

enough-webprocessor/source/src/de/enough/webprocessor/WebProcessorTask.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,11 @@ private void appendKeywordEntries(Keyword[] myKeywords, HashMap entriesByKeyword
484484
int idStartPos = currentLine.indexOf(" id=\"");
485485
if (idStartPos != -1) {
486486
int idEndPos = currentLine.indexOf( '"', idStartPos + 6 );
487+
if (idEndPos == -1)
488+
{
489+
String message = "Unable to process line " + currentLine + " in " + path + ": id is not closed";
490+
throw new BuildException(message);
491+
}
487492
String id = currentLine.substring( idStartPos + 5, idEndPos );
488493
int headingStartPos = currentLine.indexOf( '>', idEndPos );
489494
int headingEndPos = currentLine.indexOf('<', headingStartPos );

0 commit comments

Comments
 (0)