You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2012/02/21 11:07:57 UTC
svn commit: r1291684 - in
/pivot/trunk/tests/src/org/apache/pivot/tests/issues: Pivot838.java
Pivot838ParagraphListener.java
Author: smartini
Date: Tue Feb 21 10:07:57 2012
New Revision: 1291684
URL: http://svn.apache.org/viewvc?rev=1291684&view=rev
Log:
renamed test for the TextArea ParagraphListener into Pivot838ParagraphListener (but not strictly related to issue 838), and keep Pivot838 test class runnable, but empty
Added:
pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838ParagraphListener.java
Modified:
pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838.java
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838.java?rev=1291684&r1=1291683&r2=1291684&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838.java Tue Feb 21 10:07:57 2012
@@ -20,10 +20,6 @@ import org.apache.pivot.collections.Map;
import org.apache.pivot.wtk.Application;
import org.apache.pivot.wtk.DesktopApplicationContext;
import org.apache.pivot.wtk.Display;
-import org.apache.pivot.wtk.TextArea;
-import org.apache.pivot.wtk.TextArea.Paragraph;
-import org.apache.pivot.wtk.TextArea.ParagraphListener;
-import org.apache.pivot.wtk.TextAreaContentListener;
import org.apache.pivot.wtk.Window;
public class Pivot838 extends Application.Adapter
@@ -32,34 +28,9 @@ public class Pivot838 extends Applicatio
@Override
public void startup(Display display, Map<String, String> properties) throws Exception
{
- TextArea textArea = new TextArea();
- textArea.setText("abcxyz");
+ // TODO: empty currently ...
- final ParagraphListener paragraphListener = new ParagraphListener.Adapter() {
- @Override
- public void textInserted(Paragraph paragraph, int index, int count) {
- System.out.println("Text inserted\n\tparagraph content: '" + paragraph.getCharacters() + "" + "'\n\tindex: " + index + "\n\tcount: " + count);
- }
-
- @Override
- public void textRemoved(Paragraph paragraph, int index, int count) {
- System.out.println("Text removed\n\tparagraph content: '" + paragraph.getCharacters() + "'\n\tindex: " + index + "\n\tcount: " + count);
- }
- };
-
- textArea.getParagraphs().get(0).getParagraphListeners().add(paragraphListener);
- textArea.getTextAreaContentListeners().add(new TextAreaContentListener.Adapter() {
- @Override
- public void paragraphInserted(TextArea textArea, int index)
- {
- Paragraph paragraph = textArea.getParagraphs().get(index);
- System.out.println("Paragraph inserted\n\tparagraph content: '" + paragraph.getCharacters() + "'\n\tindex: " + index);
-
- paragraph.getParagraphListeners().add(paragraphListener);
- }
- });
-
- Window window = new Window(textArea);
+ Window window = new Window();
window.open(display);
}
Added: pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838ParagraphListener.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838ParagraphListener.java?rev=1291684&view=auto
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838ParagraphListener.java (added)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot838ParagraphListener.java Tue Feb 21 10:07:57 2012
@@ -0,0 +1,70 @@
+/*
+ * 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.tests.issues;
+
+import org.apache.pivot.collections.Map;
+import org.apache.pivot.wtk.Application;
+import org.apache.pivot.wtk.DesktopApplicationContext;
+import org.apache.pivot.wtk.Display;
+import org.apache.pivot.wtk.TextArea;
+import org.apache.pivot.wtk.TextArea.Paragraph;
+import org.apache.pivot.wtk.TextArea.ParagraphListener;
+import org.apache.pivot.wtk.TextAreaContentListener;
+import org.apache.pivot.wtk.Window;
+
+public class Pivot838ParagraphListener extends Application.Adapter
+{
+
+ @Override
+ public void startup(Display display, Map<String, String> properties) throws Exception
+ {
+ TextArea textArea = new TextArea();
+ textArea.setText("abcxyz");
+
+ final ParagraphListener paragraphListener = new ParagraphListener.Adapter() {
+ @Override
+ public void textInserted(Paragraph paragraph, int index, int count) {
+ System.out.println("Text inserted\n\tparagraph content: '" + paragraph.getCharacters() + "" + "'\n\tindex: " + index + "\n\tcount: " + count);
+ }
+
+ @Override
+ public void textRemoved(Paragraph paragraph, int index, int count) {
+ System.out.println("Text removed\n\tparagraph content: '" + paragraph.getCharacters() + "'\n\tindex: " + index + "\n\tcount: " + count);
+ }
+ };
+
+ textArea.getParagraphs().get(0).getParagraphListeners().add(paragraphListener);
+ textArea.getTextAreaContentListeners().add(new TextAreaContentListener.Adapter() {
+ @Override
+ public void paragraphInserted(TextArea textArea, int index)
+ {
+ Paragraph paragraph = textArea.getParagraphs().get(index);
+ System.out.println("Paragraph inserted\n\tparagraph content: '" + paragraph.getCharacters() + "'\n\tindex: " + index);
+
+ paragraph.getParagraphListeners().add(paragraphListener);
+ }
+ });
+
+ Window window = new Window(textArea);
+ window.open(display);
+ }
+
+ public static void main(String[] args) {
+ DesktopApplicationContext.main(Pivot838ParagraphListener.class, args);
+ }
+
+}