diff --git a/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java b/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java index 955704c..5c35951 100644 --- a/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java +++ b/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java @@ -6,6 +6,9 @@ * * @author Robert Virkus, j2mepolish@enough.de * @see UniformItemSource + * @see UniformContainer + * @see SourcedContainer + * @see SourcedLazyContainer */ public interface ItemSource { diff --git a/enough-polish-sample-messaging/resources/base/style/polish.css b/enough-polish-sample-messaging/resources/base/style/polish.css index 71625d6..ac64682 100644 --- a/enough-polish-sample-messaging/resources/base/style/polish.css +++ b/enough-polish-sample-messaging/resources/base/style/polish.css @@ -178,10 +178,21 @@ info { layout: vertical-center; } +.messageFromMe:hover +{ + background-color: #fcc; +} + .messageFromUser extends messageFromMe { background-color: red; } +.messageFromUser:hover +{ + background-color: #fcc; +} + + .simpleMessage { text-effect: smiley-extended; label-style: nameLabel; @@ -198,12 +209,22 @@ info { background-color: silver; } +.simpleMessageFromMe:hover +{ + background-color: #cfc; +} + .simpleMessageFromYou extends simpleMessage { layout: right; background-color: #faa; } +.simpleMessageFromYou:hover +{ + background-color: #cfc; +} + /********************* CONTACT FORM ******************************************************************************************************/ .contactList { diff --git a/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java b/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java index 377092f..50c4e84 100644 --- a/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java +++ b/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java @@ -47,7 +47,6 @@ public class SimpleMessageForm extends FramedForm { TextField inputField; - private ArrayList messageList = new ArrayList(); private MessageItemSource itemSource; /** @@ -118,6 +117,7 @@ public Item createItem(int index) { //#style simpleMessageFromYou item = new StringItem(message.getSender() + ":", text); }; + //item.setDefaultCommand( new Command("Resend", Command.ITEM, 2)); return item; } diff --git a/enough-polish-website/site/source/docs/gui-item-container.html b/enough-polish-website/site/source/docs/gui-item-container.html new file mode 100644 index 0000000..b5e0ad9 --- /dev/null +++ b/enough-polish-website/site/source/docs/gui-item-container.html @@ -0,0 +1,97 @@ +<%define inDocumentationSection %> +<%define inDocumentationSection.gui %> +<%set title = J2ME Polish: Item %> +<%set basedir = ../ %> +<%include start_syntax.txt %> + +

Container

+ + <%index %> + +

+ Container can hold many items + + Container contain different items. They are the basis for all J2ME Polish screens like + Form, FramedForm + or List. +
+ You can create arbitrary complex items by nesting containers into each other. +
+ You can also use columns and rows for containers or use any of the view-types + available for Containers. +

+ +

ItemSource

+

+ The following containers require an item source. An de.enough.polish.ui.ItemSource + is responsible for translating underlying data into UI items. When an ItemSource is used, an + de.enough.polish.ui.ItemConsumer will register + with the source, so that the ItemSource can inform the ItemConsumer when the underlying data has been updated. +

+ +

Using a Different Container

+

+ If you want to use a different container you can either use one of the provided convenience forms + such as UniformForm + or SourcedForm + or you register the container as a root container using Screen.setRootContainer(Container): +

+
+public class MyFramedForm extends FramedForm
+{
+	public MyFramedForm()
+	{
+		super("title");
+		ItemSource mySource = new MyItemSource();
+		SourcedLazyContainer container = new SourcedLazyContainer(mySource, 5, 15);
+		setRootContainer(container);
+	}
+}
+
+ +

SourcedContainer

+

+ A de.enough.polish.ui.SourcedContainer + is a normal container that uses an ItemSource. +

+ +

SourcedLazyContainer

+

+ The de.enough.polish.ui.SourcedLazyContainer + only loads items when they are required. In contrast to the UniformContainer those Items can vary in height, + a typical example include messages or news entries. +
+ In combination with data storage like de.enough.polish.io.ChunkedStorageCollection, + de.enough.polish.io.ChunkedStorageRmsSystem + and the like you can create endless scrolling screens. +

+ +

UniformContainer

+

+ The de.enough.polish.ui.UniformContainer + along with the convenience de.enough.polish.ui.UniformForm + allow you to show vast numbers of entries without using too much memory. +
+ For best memory efficiency the UniformContainer reuses items - for doing that you need to supply a + de.enough.polish.ui.UniformItemSource + instead of an ItemSource. The UniformItemSource additionally defines a void populateItem(int itemIndex, Item item ) + method for reusing items. +
+ A UniformContainer only supports items that have the same height. +

+ +

Sample App

+

+ Please compare the 'messaging' sample application for using ItemSource, UniformContainer and SourcedLazyContainer. +

+ +

JavaDoc

+ + +<%include end.txt %> diff --git a/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html b/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html index 63e35e0..adaa9ca 100644 --- a/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html +++ b/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html @@ -136,8 +136,9 @@

size-increase view-type

View Types for Container based UI Components

- You can apply the following view-types for all Container based UI components - basically these are all - components that can contain a number of items. Examples include ChoiceGroup, + You can apply the following view-types for all Container + based UI components - basically these are all components that can contain a number of items. + Examples include ChoiceGroup, List, Form, HtmlBrowser and commands menu.

diff --git a/enough-polish-website/site/source/docs/gui-visualguide.html b/enough-polish-website/site/source/docs/gui-visualguide.html index c52fc56..2d0a68f 100644 --- a/enough-polish-website/site/source/docs/gui-visualguide.html +++ b/enough-polish-website/site/source/docs/gui-visualguide.html @@ -276,6 +276,12 @@

ClockItem

The ClockItem displays the time. +

Container

+ + + +
Container can hold many itemsDifferent container implementations allow you to show an insane amount of data in one screen.
+

CustomItem

@@ -419,5 +425,7 @@

TreeItem

Create Your Own CustomItem Interact with hierarchical data with the TreeItem.
+ + <%include end.txt %> diff --git a/enough-polish-website/site/source/images/gui-item-container.png b/enough-polish-website/site/source/images/gui-item-container.png new file mode 100644 index 0000000..bd5f906 Binary files /dev/null and b/enough-polish-website/site/source/images/gui-item-container.png differ diff --git a/enough-webprocessor/source/src/de/enough/webprocessor/WebProcessorTask.java b/enough-webprocessor/source/src/de/enough/webprocessor/WebProcessorTask.java index ae5234c..fd67fe0 100644 --- a/enough-webprocessor/source/src/de/enough/webprocessor/WebProcessorTask.java +++ b/enough-webprocessor/source/src/de/enough/webprocessor/WebProcessorTask.java @@ -484,6 +484,11 @@ private void appendKeywordEntries(Keyword[] myKeywords, HashMap entriesByKeyword int idStartPos = currentLine.indexOf(" id=\""); if (idStartPos != -1) { int idEndPos = currentLine.indexOf( '"', idStartPos + 6 ); + if (idEndPos == -1) + { + String message = "Unable to process line " + currentLine + " in " + path + ": id is not closed"; + throw new BuildException(message); + } String id = currentLine.substring( idStartPos + 5, idEndPos ); int headingStartPos = currentLine.indexOf( '>', idEndPos ); int headingEndPos = currentLine.indexOf('<', headingStartPos );