You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2010/07/20 15:59:24 UTC
svn commit: r965850 - in /pivot/trunk:
demos/src/org/apache/pivot/demos/richtexteditor/
wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/text/
Author: noelgrandin
Date: Tue Jul 20 13:59:23 2010
New Revision: 965850
URL: http://svn.apache.org/viewvc?rev=965850&view=rev
Log:
Implement numbered and bulleted list handling in TextAreaSkin
Added:
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBlockView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBulletedListView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListItemView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNumberedListView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinVerticalElementView.java
Modified:
pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/document.bxml
pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/richtexteditor.bxml
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinComponentNodeView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinDocumentView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNodeView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinSpanView.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/BulletedList.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/List.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NumberedList.java
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/document.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/document.bxml?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/document.bxml (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/document.bxml Tue Jul 20 13:59:23 2010
@@ -30,4 +30,81 @@ limitations under the License.
<Paragraph foregroundColor="red">abcd</Paragraph>
<Paragraph backgroundColor="red">abcd</Paragraph>
<Paragraph>abcd</Paragraph>
+ <NumberedList style="decimal">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </NumberedList>
+ <NumberedList style="lower_alpha">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </NumberedList>
+ <NumberedList style="upper_alpha">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </NumberedList>
+ <NumberedList style="lower_roman">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </NumberedList>
+ <NumberedList style="upper_roman">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </NumberedList>
+ <BulletedList style="CIRCLE">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </BulletedList>
+ <BulletedList style="CIRCLE_OUTLINE">
+ <List.Item>
+ <Paragraph>item1</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item2</Paragraph>
+ </List.Item>
+ <List.Item>
+ <Paragraph>item3</Paragraph>
+ </List.Item>
+ </BulletedList>
</Document>
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/richtexteditor.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/richtexteditor.bxml?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/richtexteditor.bxml (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/richtexteditor/richtexteditor.bxml Tue Jul 20 13:59:23 2010
@@ -25,7 +25,7 @@ limitations under the License.
<TablePane.Column width="1*"/>
</columns>
<TablePane.Row height="-1">
- <FlowPane styles="{padding:1, horizontalSpacing:10, alignToBaseline:true}">
+ <FlowPane styles="{padding:1, alignToBaseline:true}">
<PushButton bxml:id="openFileButton" buttonData="Open File"/>
<PushButton bxml:id="saveFileButton" buttonData="Save File"/>
<Label text=" "/> <!-- spacer -->
@@ -34,23 +34,21 @@ limitations under the License.
<PushButton bxml:id="underlineButton" buttonData="Underline"/>
<PushButton bxml:id="strikethroughButton" buttonData="Strikethrough"/>
<Label text=" "/> <!-- spacer -->
- <FlowPane>
- <Label text="Foreground"/>
- <ColorChooserButton bxml:id="foregroundColorChooserButton" selectedColor="#000000"/>
- </FlowPane>
- <FlowPane>
- <Label text="Background"/>
- <ColorChooserButton bxml:id="backgroundColorChooserButton" selectedColor="#ffffff"/>
- </FlowPane>
+ <Label text="Foreground"/>
+ <ColorChooserButton bxml:id="foregroundColorChooserButton" selectedColor="#000000"/>
+ <Label text="Background"/>
+ <ColorChooserButton bxml:id="backgroundColorChooserButton" selectedColor="#ffffff"/>
+ <Label text=" "/> <!-- spacer -->
+ <Label text="Font"/>
<ListButton bxml:id="fontFamilyListButton"/>
<ListButton bxml:id="fontSizeListButton"/>
+ <Label text=" "/> <!-- spacer -->
+ <Label text="Horizontal Align"/>
+ <PushButton bxml:id="alignLeftButton" buttonData="Left"/>
+ <PushButton bxml:id="alignCentreButton" buttonData="Centre"/>
+ <PushButton bxml:id="alignRightButton" buttonData="Right"/>
+ <Label text=" "/> <!-- spacer -->
<Checkbox bxml:id="wrapTextCheckbox" buttonData="Wrap Text" selected="false"/>
- <FlowPane>
- <Label text="Horizontal Align"/>
- <PushButton bxml:id="alignLeftButton" buttonData="Left"/>
- <PushButton bxml:id="alignCentreButton" buttonData="Centre"/>
- <PushButton bxml:id="alignRightButton" buttonData="Right"/>
- </FlowPane>
</FlowPane>
</TablePane.Row>
<TablePane.Row height="-1">
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Tue Jul 20 13:59:23 2010
@@ -41,10 +41,13 @@ import org.apache.pivot.wtk.TextArea;
import org.apache.pivot.wtk.TextAreaListener;
import org.apache.pivot.wtk.TextAreaSelectionListener;
import org.apache.pivot.wtk.Theme;
+import org.apache.pivot.wtk.text.BulletedList;
import org.apache.pivot.wtk.text.ComponentNode;
import org.apache.pivot.wtk.text.Document;
import org.apache.pivot.wtk.text.ImageNode;
+import org.apache.pivot.wtk.text.List;
import org.apache.pivot.wtk.text.Node;
+import org.apache.pivot.wtk.text.NumberedList;
import org.apache.pivot.wtk.text.Paragraph;
import org.apache.pivot.wtk.text.TextNode;
@@ -1082,6 +1085,12 @@ public class TextAreaSkin extends Contai
nodeView = new TextAreaSkinComponentNodeView((ComponentNode)node);
} else if (node instanceof org.apache.pivot.wtk.text.Span) {
nodeView = new TextAreaSkinSpanView(this, (org.apache.pivot.wtk.text.Span)node);
+ } else if (node instanceof NumberedList) {
+ nodeView = new TextAreaSkinNumberedListView(this, (NumberedList)node);
+ } else if (node instanceof BulletedList) {
+ nodeView = new TextAreaSkinBulletedListView(this, (BulletedList)node);
+ } else if (node instanceof List.Item) {
+ nodeView = new TextAreaSkinListItemView(this, (List.Item)node);
} else {
throw new IllegalArgumentException("Unsupported node type: "
+ node.getClass().getName());
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBlockView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBlockView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBlockView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBlockView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pivot.wtk.skin;
+
+import org.apache.pivot.wtk.HorizontalAlignment;
+import org.apache.pivot.wtk.text.Block;
+import org.apache.pivot.wtk.text.BlockListener;
+
+abstract class TextAreaSkinBlockView extends TextAreaSkinElementView implements
+ BlockListener {
+
+ public TextAreaSkinBlockView(Block block) {
+ super(block);
+ }
+
+ @Override
+ protected void attach() {
+ super.attach();
+
+ Block block = (Block)getNode();
+ block.getBlockListeners().add(this);
+ }
+
+ @Override
+ protected void detach() {
+ super.detach();
+
+ Block block = (Block)getNode();
+ block.getBlockListeners().remove(this);
+ }
+
+ @Override
+ public void horizontalAlignmentChanged(Block block, HorizontalAlignment previousHorizontalAlignment) {
+ invalidate();
+ }
+}
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBulletedListView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBulletedListView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBulletedListView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinBulletedListView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pivot.wtk.skin;
+
+import org.apache.pivot.wtk.text.BulletedList;
+import org.apache.pivot.wtk.text.BulletedListListener;
+
+class TextAreaSkinBulletedListView extends TextAreaSkinListView implements BulletedListListener {
+
+ public TextAreaSkinBulletedListView(TextAreaSkin textAreaSkin, BulletedList bulletedList) {
+ super(textAreaSkin, bulletedList);
+ }
+
+ @Override
+ protected void attach() {
+ super.attach();
+
+ BulletedList bulletedList = (BulletedList)getNode();
+ bulletedList.getBulletedListListeners().add(this);
+ }
+
+ @Override
+ protected void detach() {
+ super.detach();
+
+ BulletedList bulletedList = (BulletedList)getNode();
+ bulletedList.getBulletedListListeners().remove(this);
+ }
+
+ @Override
+ public void validate() {
+ if (!isValid()) {
+
+ BulletedList bulletedList = (BulletedList)getNode();
+
+ for (TextAreaSkinNodeView nodeView : this) {
+ TextAreaSkinListItemView listItemView = (TextAreaSkinListItemView)nodeView;
+
+ switch (bulletedList.getStyle()) {
+ case CIRCLE:
+ listItemView.setIndexText("\u2022 ");
+ break;
+ case CIRCLE_OUTLINE:
+ listItemView.setIndexText("\u25e6 ");
+ break;
+ }
+ }
+
+ this.maxIndexTextWidth = 0;
+ for (TextAreaSkinNodeView nodeView : this) {
+ TextAreaSkinListItemView listItemView = (TextAreaSkinListItemView)nodeView;
+ this.maxIndexTextWidth = Math.max(this.maxIndexTextWidth,
+ listItemView.getIndexTextWidth());
+ }
+
+ super.validate();
+ }
+ }
+
+ @Override
+ public void styleChanged(BulletedList bulletedList, BulletedList.Style previousStyle) {
+ invalidate();
+ }
+}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinComponentNodeView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinComponentNodeView.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinComponentNodeView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinComponentNodeView.java Tue Jul 20 13:59:23 2010
@@ -25,7 +25,7 @@ import org.apache.pivot.wtk.FocusTravers
import org.apache.pivot.wtk.text.ComponentNode;
import org.apache.pivot.wtk.text.ComponentNodeListener;
-public class TextAreaSkinComponentNodeView extends TextAreaSkinNodeView implements ComponentNodeListener {
+class TextAreaSkinComponentNodeView extends TextAreaSkinNodeView implements ComponentNodeListener {
private final ComponentListener myComponentListener = new ComponentListener.Adapter() {
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinDocumentView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinDocumentView.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinDocumentView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinDocumentView.java Tue Jul 20 13:59:23 2010
@@ -16,33 +16,15 @@
*/
package org.apache.pivot.wtk.skin;
-import org.apache.pivot.collections.Sequence;
-import org.apache.pivot.wtk.Bounds;
-import org.apache.pivot.wtk.FocusTraversalDirection;
import org.apache.pivot.wtk.text.Document;
-import org.apache.pivot.wtk.text.Element;
-import org.apache.pivot.wtk.text.Node;
/**
* Document view.
*/
-class TextAreaSkinDocumentView extends TextAreaSkinElementView {
- private final TextAreaSkin textAreaSkin;
+class TextAreaSkinDocumentView extends TextAreaSkinVerticalElementView {
public TextAreaSkinDocumentView(TextAreaSkin textAreaSkin, Document document) {
- super(document);
- this.textAreaSkin = textAreaSkin;
- }
-
- @Override
- public void attach() {
- super.attach();
-
- // Attach child node views
- Document document = (Document)getNode();
- for (Node node : document) {
- add(textAreaSkin.createNodeView(node));
- }
+ super(textAreaSkin, document);
}
@Override
@@ -57,180 +39,13 @@ class TextAreaSkinDocumentView extends T
super.invalidate();
textAreaSkin.invalidateComponent();
}
-
+
@Override
public void validate() {
- // TODO At some point, we may want to optimize this method by deferring layout of
- // non-visible views. If so, we should not recycle views but rather recreate them
- // (as is done in ParagraphView). This way, we avoid thread contention over the
- // existing views (e.g. trying to paint one while modifying its size/location, etc.).
- // Any invalid node views are simply replaced (in the queued callback, when the
- // thread has finished processing the new ones). This allows the definition of
- // validate() to remain as-is. Of course, if we redefine NodeView to implement
- // ConstrainedVisual, this may no longer be an issue.
- // Note that, if anything happens to invalidate the existence of the new views before
- // they are added to the document view, we need to make sure they are disposed (i.e.
- // detached).
-
if (!isValid()) {
- int breakWidth = getBreakWidth();
-
- int width = 0;
- int height = 0;
-
- int i = 0;
- int n = getLength();
-
- while (i < n) {
- TextAreaSkinNodeView nodeView = get(i++);
- nodeView.setBreakWidth(breakWidth);
- nodeView.validate();
-
- nodeView.setLocation(0, height);
-
- width = Math.max(width, nodeView.getWidth());
- height += nodeView.getHeight();
- }
-
- setSize(width, height);
-
+ verticalValidate();
super.validate();
}
}
- @Override
- protected void setSkinLocation(int skinX, int skinY) {
- for (TextAreaSkinNodeView nodeView : this) {
- nodeView.setSkinLocation(skinX, skinY + nodeView.getY());
- }
- }
-
- @Override
- public int getInsertionPoint(int x, int y) {
- int offset = -1;
-
- for (int i = 0, n = getLength(); i < n; i++) {
- TextAreaSkinNodeView nodeView = get(i);
- Bounds nodeViewBounds = nodeView.getBounds();
-
- if (y >= nodeViewBounds.y
- && y < nodeViewBounds.y + nodeViewBounds.height) {
- offset = nodeView.getInsertionPoint(x - nodeView.getX(), y - nodeView.getY())
- + nodeView.getOffset();
- break;
- }
- }
-
- return offset;
- }
-
- @Override
- public int getNextInsertionPoint(int x, int from, FocusTraversalDirection direction) {
- int offset = -1;
-
- if (getLength() > 0) {
- if (from == -1) {
- int i = (direction == FocusTraversalDirection.FORWARD) ? 0 : getLength() - 1;
- TextAreaSkinNodeView nodeView = get(i);
- offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
-
- if (offset != -1) {
- offset += nodeView.getOffset();
- }
- } else {
- // Find the node view that contains the offset
- int n = getLength();
- int i = 0;
-
- while (i < n) {
- TextAreaSkinNodeView nodeView = get(i);
- int nodeViewOffset = nodeView.getOffset();
- int characterCount = nodeView.getCharacterCount();
-
- if (from >= nodeViewOffset
- && from < nodeViewOffset + characterCount) {
- break;
- }
-
- i++;
- }
-
- if (i < n) {
- TextAreaSkinNodeView nodeView = get(i);
- offset = nodeView.getNextInsertionPoint(x - nodeView.getX(),
- from - nodeView.getOffset(), direction);
-
- if (offset == -1) {
- // Move to the next or previous node view
- if (direction == FocusTraversalDirection.FORWARD) {
- nodeView = (i < n - 1) ? get(i + 1) : null;
- } else {
- nodeView = (i > 0) ? get(i - 1) : null;
- }
-
- if (nodeView != null) {
- offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
- }
- }
-
- if (offset != -1) {
- offset += nodeView.getOffset();
- }
- }
- }
- }
-
- return offset;
- }
-
- @Override
- public int getRowIndex(int offset) {
- int rowIndex = 0;
-
- for (TextAreaSkinNodeView nodeView : this) {
- int nodeViewOffset = nodeView.getOffset();
- int characterCount = nodeView.getCharacterCount();
-
- if (offset >= nodeViewOffset
- && offset < nodeViewOffset + characterCount) {
- rowIndex += nodeView.getRowIndex(offset - nodeView.getOffset());
- break;
- }
-
- rowIndex += nodeView.getRowCount();
- }
-
- return rowIndex;
- }
-
- @Override
- public int getRowCount() {
- int rowCount = 0;
-
- for (TextAreaSkinNodeView nodeView : this) {
- rowCount += nodeView.getRowCount();
- }
-
- return rowCount;
- }
-
- @Override
- public TextAreaSkinNodeView getNext() {
- return null;
- }
-
- @Override
- public void nodeInserted(Element element, int index) {
- super.nodeInserted(element, index);
-
- Document document = (Document)getNode();
- insert(textAreaSkin.createNodeView(document.get(index)), index);
- }
-
- @Override
- public void nodesRemoved(Element element, int index, Sequence<Node> nodes) {
- remove(index, nodes.getLength());
-
- super.nodesRemoved(element, index, nodes);
- }
}
\ No newline at end of file
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListItemView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListItemView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListItemView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListItemView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pivot.wtk.skin;
+
+import java.util.Iterator;
+
+import org.apache.pivot.wtk.text.TextNode;
+
+
+class TextAreaSkinListItemView extends TextAreaSkinVerticalElementView {
+
+ private TextNode indexTextNode;
+ private TextAreaSkinTextNodeView indexTextNodeView;
+
+ public TextAreaSkinListItemView(TextAreaSkin textAreaSkin, org.apache.pivot.wtk.text.List.Item listItem) {
+ super(textAreaSkin, listItem);
+
+ this.indexTextNode = new TextNode("");
+ }
+
+ @Override
+ protected void attach() {
+ super.attach();
+
+ // add an extra TextNodeView to render the index text
+ indexTextNodeView = new TextAreaSkinTextNodeView(textAreaSkin, indexTextNode);
+ insert(indexTextNodeView, 0);
+ }
+
+ public void setIndexText(String indexText) {
+ indexTextNode.setText(indexText);
+ indexTextNodeView.validate();
+ indexTextNodeView.setLocation(0, 0);
+ }
+
+ @Override
+ public void validate() {
+ if (!isValid()) {
+
+ indexTextNodeView.validate();
+ indexTextNodeView.setLocation(0, 0);
+
+ int breakWidth = getBreakWidth() - indexTextNodeView.getWidth();
+ int itemsWidth = 0;
+ int itemsY = 0;
+
+ // skip the first item, it's the indexText nodeView
+ Iterator<TextAreaSkinNodeView> iterator = this.iterator();
+ iterator.next();
+
+ for ( ; iterator.hasNext(); ) {
+ TextAreaSkinNodeView nodeView = iterator.next();
+ nodeView.setBreakWidth(breakWidth);
+ nodeView.validate();
+
+ nodeView.setLocation(indexTextNodeView.getWidth(), itemsY);
+
+ itemsWidth = Math.max(itemsWidth, nodeView.getWidth());
+ itemsY += nodeView.getHeight();
+ }
+
+ int width = itemsWidth + indexTextNodeView.getWidth();
+ int height = Math.max(itemsY, indexTextNodeView.getHeight());
+
+ setSize(width, height);
+
+ super.validate();
+ }
+ }
+
+ public int getIndexTextWidth() {
+ return indexTextNodeView.getWidth();
+ }
+}
\ No newline at end of file
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinListView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,24 @@
+package org.apache.pivot.wtk.skin;
+
+import org.apache.pivot.wtk.text.List;
+
+class TextAreaSkinListView extends TextAreaSkinVerticalElementView {
+
+ protected int maxIndexTextWidth;
+
+ public TextAreaSkinListView(TextAreaSkin textAreaSkin, List list) {
+ super(textAreaSkin, list);
+ }
+
+ public int getMaxIndexTextWidth() {
+ return maxIndexTextWidth;
+ }
+
+ @Override
+ public void validate() {
+ if (!isValid()) {
+ verticalValidate();
+ super.validate();
+ }
+ }
+}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNodeView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNodeView.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNodeView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNodeView.java Tue Jul 20 13:59:23 2010
@@ -193,7 +193,11 @@ abstract class TextAreaSkinNodeView impl
return node.getCharacterCount();
}
+ /**
+ * Used by TextAreaSkinParagraphView when it breaks child nodes into multiple views.
+ */
public abstract TextAreaSkinNodeView getNext();
+
public abstract int getInsertionPoint(int x, int y);
public abstract int getNextInsertionPoint(int x, int from, FocusTraversalDirection direction);
public abstract int getRowIndex(int offset);
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNumberedListView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNumberedListView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNumberedListView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinNumberedListView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pivot.wtk.skin;
+
+import org.apache.pivot.wtk.text.NumberedList;
+import org.apache.pivot.wtk.text.NumberedListListener;
+import org.apache.pivot.wtk.text.NumberedList.Style;
+
+class TextAreaSkinNumberedListView extends TextAreaSkinListView implements NumberedListListener {
+
+ private static class RomanValue {
+ public final int integerVal;
+ public final String romanNumeral;
+
+ public RomanValue(int integerVal, String romanNumeral) {
+ this.integerVal = integerVal;
+ this.romanNumeral = romanNumeral;
+ }
+ }
+
+ private static final RomanValue[] ROMAN_VALUE_TABLE = {
+ new RomanValue(1000, "M"),
+ new RomanValue(900, "CM"),
+ new RomanValue(500, "D"),
+ new RomanValue(400, "CD"),
+ new RomanValue(100, "C"),
+ new RomanValue(90, "XC"),
+ new RomanValue(50, "L"),
+ new RomanValue(40, "XL"),
+ new RomanValue(10, "X"),
+ new RomanValue(9, "IX"),
+ new RomanValue(5, "V"),
+ new RomanValue(4, "IV"),
+ new RomanValue(1, "I")
+ };
+
+ private static String int2roman(int n) {
+ StringBuffer result = new StringBuffer(10);
+
+ // ... Start with largest value, and work toward smallest.
+ for (RomanValue equiv : ROMAN_VALUE_TABLE) {
+ // ... Remove as many of this value as possible (maybe none).
+ while (n >= equiv.integerVal) {
+ n -= equiv.integerVal;
+ result.append(equiv.romanNumeral);
+ }
+ }
+ return result.toString();
+ }
+
+ private static String int2alpha(int n) {
+ return (char)('A' + n - 1) + "";
+ }
+
+ public TextAreaSkinNumberedListView(TextAreaSkin textAreaSkin, NumberedList numberedList) {
+ super(textAreaSkin, numberedList);
+ }
+
+ @Override
+ protected void attach() {
+ super.attach();
+
+ NumberedList numberedList = (NumberedList)getNode();
+ numberedList.getNumberedListListeners().add(this);
+ }
+
+ @Override
+ protected void detach() {
+ super.detach();
+
+ NumberedList numberedList = (NumberedList)getNode();
+ numberedList.getNumberedListListeners().remove(this);
+ }
+
+ @Override
+ public void validate() {
+ if (!isValid()) {
+
+ NumberedList numberedList = (NumberedList)getNode();
+
+ int index = 1;
+ for (TextAreaSkinNodeView nodeView : this) {
+ TextAreaSkinListItemView listItemView = (TextAreaSkinListItemView)nodeView;
+
+ switch (numberedList.getStyle()) {
+ case DECIMAL:
+ listItemView.setIndexText(index + ". ");
+ break;
+ case LOWER_ALPHA:
+ listItemView.setIndexText(int2alpha(index).toLowerCase() + ". ");
+ break;
+ case UPPER_ALPHA:
+ listItemView.setIndexText(int2alpha(index) + ". ");
+ break;
+ case LOWER_ROMAN:
+ listItemView.setIndexText(int2roman(index).toLowerCase() + ". ");
+ break;
+ case UPPER_ROMAN:
+ listItemView.setIndexText(int2roman(index) + ". ");
+ break;
+ }
+
+ index++;
+ }
+
+ this.maxIndexTextWidth = 0;
+ for (TextAreaSkinNodeView nodeView : this) {
+ TextAreaSkinListItemView listItemView = (TextAreaSkinListItemView)nodeView;
+ this.maxIndexTextWidth = Math.max(this.maxIndexTextWidth,
+ listItemView.getIndexTextWidth());
+ }
+
+ super.validate();
+ }
+ }
+
+ @Override
+ public void styleChanged(NumberedList numberedList, Style previousStyle) {
+ invalidate();
+ }
+}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinParagraphView.java Tue Jul 20 13:59:23 2010
@@ -24,12 +24,10 @@ import org.apache.pivot.wtk.Bounds;
import org.apache.pivot.wtk.FocusTraversalDirection;
import org.apache.pivot.wtk.HorizontalAlignment;
import org.apache.pivot.wtk.Platform;
-import org.apache.pivot.wtk.text.Block;
-import org.apache.pivot.wtk.text.BlockListener;
import org.apache.pivot.wtk.text.Node;
import org.apache.pivot.wtk.text.Paragraph;
-class TextAreaSkinParagraphView extends TextAreaSkinElementView implements BlockListener {
+class TextAreaSkinParagraphView extends TextAreaSkinBlockView {
private static final int PARAGRAPH_TERMINATOR_WIDTH = 4;
@@ -52,14 +50,6 @@ class TextAreaSkinParagraphView extends
}
@Override
- protected void attach() {
- super.attach();
-
- Block block = (Block)getNode();
- block.getBlockListeners().add(this);
- }
-
- @Override
public void invalidate() {
super.invalidate();
terminatorBounds = null;
@@ -68,6 +58,9 @@ class TextAreaSkinParagraphView extends
@Override
public void validate() {
if (!isValid()) {
+ // Remove and re-create the child views, because of line-breaking, a single TextNode
+ // may be added as many TextAreaSkinTextNodeView's.
+
// Break the views into multiple rows
int breakWidth = getBreakWidth();
@@ -355,8 +348,4 @@ class TextAreaSkinParagraphView extends
return bounds;
}
- @Override
- public void horizontalAlignmentChanged(Block block, HorizontalAlignment previousHorizontalAlignment) {
- invalidate();
- }
}
\ No newline at end of file
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinSpanView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinSpanView.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinSpanView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinSpanView.java Tue Jul 20 13:59:23 2010
@@ -35,7 +35,7 @@ class TextAreaSkinSpanView extends TextA
public void validate() {
if (!isValid()) {
// I have to re-create my children here instead of in attach(), because that is how ParagraphView works,
- // and ParagraphView is always my super-node.
+ // and ParagraphView is always my parent node.
// Clear all existing views
remove(0, getLength());
@@ -46,16 +46,14 @@ class TextAreaSkinSpanView extends TextA
add(textAreaSkin.createNodeView(node));
}
+ // TODO like TextAreaSkinTextNodeView, I need to implement line-breaking
+
int breakWidth = getBreakWidth();
int width = 0;
int height = 0;
- int i = 0;
- int n = getLength();
-
- while (i < n) {
- TextAreaSkinNodeView nodeView = get(i++);
+ for (TextAreaSkinNodeView nodeView : this) {
nodeView.setBreakWidth(breakWidth);
nodeView.validate();
Added: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinVerticalElementView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinVerticalElementView.java?rev=965850&view=auto
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinVerticalElementView.java (added)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkinVerticalElementView.java Tue Jul 20 13:59:23 2010
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pivot.wtk.skin;
+
+import org.apache.pivot.collections.Sequence;
+import org.apache.pivot.wtk.Bounds;
+import org.apache.pivot.wtk.FocusTraversalDirection;
+import org.apache.pivot.wtk.text.Element;
+import org.apache.pivot.wtk.text.Node;
+
+/**
+ * Some of the classes in the text hierarchy are very similar in layout ie. they lay their children out vertically. This class groups that functionality.
+ */
+abstract class TextAreaSkinVerticalElementView extends TextAreaSkinElementView {
+ protected final TextAreaSkin textAreaSkin;
+
+ public TextAreaSkinVerticalElementView(TextAreaSkin textAreaSkin, Element element) {
+ super(element);
+ this.textAreaSkin = textAreaSkin;
+ }
+
+ @Override
+ protected void attach() {
+ super.attach();
+
+ // Attach child node views
+ Element element = (Element)getNode();
+ for (Node node : element) {
+ add(textAreaSkin.createNodeView(node));
+ }
+ }
+
+ protected void verticalValidate() {
+ // TODO At some point, we may want to optimize this method by deferring layout of
+ // non-visible views. If so, we should not recycle views but rather recreate them
+ // (as is done in ParagraphView). This way, we avoid thread contention over the
+ // existing views (e.g. trying to paint one while modifying its size/location, etc.).
+ // Any invalid node views are simply replaced (in the queued callback, when the
+ // thread has finished processing the new ones). This allows the definition of
+ // validate() to remain as-is. Of course, if we redefine NodeView to implement
+ // ConstrainedVisual, this may no longer be an issue.
+ // Note that, if anything happens to invalidate the existence of the new views before
+ // they are added to the document view, we need to make sure they are disposed (i.e.
+ // detached).
+
+ int breakWidth = getBreakWidth();
+
+ int width = 0;
+ int height = 0;
+
+ for (TextAreaSkinNodeView nodeView : this) {
+ nodeView.setBreakWidth(breakWidth);
+ nodeView.validate();
+
+ nodeView.setLocation(0, height);
+
+ width = Math.max(width, nodeView.getWidth());
+ height += nodeView.getHeight();
+ }
+
+ setSize(width, height);
+ }
+
+ @Override
+ protected void setSkinLocation(int skinX, int skinY) {
+ for (TextAreaSkinNodeView nodeView : this) {
+ nodeView.setSkinLocation(skinX, skinY + nodeView.getY());
+ }
+ }
+
+ @Override
+ public TextAreaSkinNodeView getNext() {
+ return null;
+ }
+
+ @Override
+ public int getInsertionPoint(int x, int y) {
+ int offset = -1;
+
+ for (int i = 0, n = getLength(); i < n; i++) {
+ TextAreaSkinNodeView nodeView = get(i);
+ Bounds nodeViewBounds = nodeView.getBounds();
+
+ if (y >= nodeViewBounds.y
+ && y < nodeViewBounds.y + nodeViewBounds.height) {
+ offset = nodeView.getInsertionPoint(x - nodeView.getX(), y - nodeView.getY())
+ + nodeView.getOffset();
+ break;
+ }
+ }
+
+ return offset;
+ }
+
+ @Override
+ public int getNextInsertionPoint(int x, int from, FocusTraversalDirection direction) {
+ int offset = -1;
+
+ if (getLength() > 0) {
+ if (from == -1) {
+ int i = (direction == FocusTraversalDirection.FORWARD) ? 0 : getLength() - 1;
+ TextAreaSkinNodeView nodeView = get(i);
+ offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
+
+ if (offset != -1) {
+ offset += nodeView.getOffset();
+ }
+ } else {
+ // Find the node view that contains the offset
+ int n = getLength();
+ int i = 0;
+
+ while (i < n) {
+ TextAreaSkinNodeView nodeView = get(i);
+ int nodeViewOffset = nodeView.getOffset();
+ int characterCount = nodeView.getCharacterCount();
+
+ if (from >= nodeViewOffset
+ && from < nodeViewOffset + characterCount) {
+ break;
+ }
+
+ i++;
+ }
+
+ if (i < n) {
+ TextAreaSkinNodeView nodeView = get(i);
+ offset = nodeView.getNextInsertionPoint(x - nodeView.getX(),
+ from - nodeView.getOffset(), direction);
+
+ if (offset == -1) {
+ // Move to the next or previous node view
+ if (direction == FocusTraversalDirection.FORWARD) {
+ nodeView = (i < n - 1) ? get(i + 1) : null;
+ } else {
+ nodeView = (i > 0) ? get(i - 1) : null;
+ }
+
+ if (nodeView != null) {
+ offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
+ }
+ }
+
+ if (offset != -1) {
+ offset += nodeView.getOffset();
+ }
+ }
+ }
+ }
+
+ return offset;
+ }
+
+ @Override
+ public int getRowIndex(int offset) {
+ int rowIndex = 0;
+
+ for (TextAreaSkinNodeView nodeView : this) {
+ int nodeViewOffset = nodeView.getOffset();
+ int characterCount = nodeView.getCharacterCount();
+
+ if (offset >= nodeViewOffset
+ && offset < nodeViewOffset + characterCount) {
+ rowIndex += nodeView.getRowIndex(offset - nodeView.getOffset());
+ break;
+ }
+
+ rowIndex += nodeView.getRowCount();
+ }
+
+ return rowIndex;
+ }
+
+ @Override
+ public int getRowCount() {
+ int rowCount = 0;
+
+ for (TextAreaSkinNodeView nodeView : this) {
+ rowCount += nodeView.getRowCount();
+ }
+
+ return rowCount;
+ }
+
+ @Override
+ public void nodeInserted(Element element, int index) {
+ super.nodeInserted(element, index);
+
+ insert(textAreaSkin.createNodeView(element.get(index)), index);
+ }
+
+ @Override
+ public void nodesRemoved(Element element, int index, Sequence<Node> nodes) {
+ remove(index, nodes.getLength());
+
+ super.nodesRemoved(element, index, nodes);
+ }
+}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/BulletedList.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/BulletedList.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/BulletedList.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/BulletedList.java Tue Jul 20 13:59:23 2010
@@ -26,7 +26,10 @@ public class BulletedList extends List {
* List bullet styles.
*/
public enum Style {
- CIRCLE, CIRCLE_OUTLINE, SQUARE, SQUARE_OUTLINE
+ /** unicode character 0x2022 aka. "BULLET" */
+ CIRCLE,
+ /** unicode character 0x25e6 aka. "WHITE BULLET" */
+ CIRCLE_OUTLINE
}
private static class BulletedListListenerList extends ListenerList<BulletedListListener>
@@ -68,6 +71,14 @@ public class BulletedList extends List {
}
}
+ public final void setStyle(String style) {
+ if (style == null) {
+ throw new IllegalArgumentException("style is null.");
+ }
+
+ setStyle(Style.valueOf(style.toUpperCase()));
+ }
+
@Override
public BulletedList duplicate(boolean recursive) {
return new BulletedList(this, recursive);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/List.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/List.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/List.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/List.java Tue Jul 20 13:59:23 2010
@@ -25,7 +25,7 @@ public abstract class List extends Block
/**
* Element representing a list item.
*/
- public class Item extends Element {
+ public static class Item extends Element {
public Item() {
super();
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NumberedList.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NumberedList.java?rev=965850&r1=965849&r2=965850&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NumberedList.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NumberedList.java Tue Jul 20 13:59:23 2010
@@ -17,6 +17,7 @@
package org.apache.pivot.wtk.text;
import org.apache.pivot.util.ListenerList;
+import org.apache.pivot.wtk.FileBrowserSheet.Mode;
/**
* Element representing a numbered list.
@@ -72,6 +73,14 @@ public class NumberedList extends List {
}
}
+ public final void setStyle(String style) {
+ if (style == null) {
+ throw new IllegalArgumentException("style is null.");
+ }
+
+ setStyle(Style.valueOf(style.toUpperCase()));
+ }
+
@Override
public NumberedList duplicate(boolean recursive) {
return new NumberedList(this, recursive);
Re: svn commit: r965850 - in /pivot/trunk: demos/src/org/apache/pivot/demos/richtexteditor/
wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/text/
Posted by Noel Grandin <no...@gmail.com>.
Thanks! There are still some rough edges in the Skin code, but it's
coming along.
On Wed, Jul 21, 2010 at 01:07, Greg Brown <gk...@mac.com> wrote:
> Noel, the rich text stuff is looking good! I haven't looked at the code itself yet, but the demo is impressive.
>
> Nice work.
>
> G
>
>
Re: svn commit: r965850 - in /pivot/trunk:
demos/src/org/apache/pivot/demos/richtexteditor/
wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/text/
Posted by Greg Brown <gk...@mac.com>.
Noel, the rich text stuff is looking good! I haven't looked at the code itself yet, but the demo is impressive.
Nice work.
G