Permalink
Browse files

Created v2.0 tag

git-svn-id: https://svn.apache.org/repos/asf/pivot/tags/v2.0@1051372 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
2 parents 74621e9 + 3675a86 commit 70ca248d6b13d6576125bd0db5ac0f1eaa27b5c3 Todd Volkert committed Dec 21, 2010
Showing with 1,572 additions and 1,595 deletions.
  1. +125 −125 core/src/org/apache/pivot/serialization/StringSerializer.java
  2. +82 −82 core/test/org/apache/pivot/serialization/test/ByteArraySerializerTest.java
  3. +85 −85 core/test/org/apache/pivot/serialization/test/StringSerializerTest.java
  4. +2 −2 demos/www/swing-demo.template.html
  5. +16 −0 eclipse/src/org/apache/pivot/eclipse/PivotApplicationLaunchShortcut.java
  6. +16 −0 examples/src/org/apache/pivot/examples/deployment/DeploymentExample.java
  7. +390 −390 tests/src/org/apache/pivot/tests/EnumBean.java
  8. +81 −81 tests/src/org/apache/pivot/tests/EnumBeanTest.java
  9. +45 −45 tests/src/org/apache/pivot/tests/TerraTheme_test.json
  10. +228 −228 tests/src/org/apache/pivot/tests/enum_bean.bxml
  11. +2 −1 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
  12. +21 −21 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin_de.json
  13. +21 −21 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin_it.json
  14. +21 −21 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin_pl.json
  15. +27 −27 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin_de.json
  16. +27 −27 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin_it.json
  17. +27 −27 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin_pl.json
  18. +45 −45 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_dark.json
  19. +45 −45 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_swing.json
  20. +45 −45 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_ubuntu.json
  21. +45 −45 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_win2k.json
  22. +45 −45 wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme_winxp2.json
  23. +23 −23 wtk/src/org/apache/pivot/wtk/Alert_it.json
  24. +23 −23 wtk/src/org/apache/pivot/wtk/Alert_pl.json
  25. +18 −18 wtk/src/org/apache/pivot/wtk/Prompt_de.json
  26. +18 −18 wtk/src/org/apache/pivot/wtk/Prompt_it.json
  27. +18 −18 wtk/src/org/apache/pivot/wtk/Prompt_pl.json
  28. +2 −12 wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java
  29. +2 −11 wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java
  30. +2 −11 wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java
  31. +2 −12 wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java
  32. +3 −19 wtk/src/org/apache/pivot/wtk/content/TableViewMultiCellRenderer.java
  33. +2 −11 wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java
  34. +2 −11 wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java
  35. +16 −0 wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinListView.java
@@ -1,125 +1,125 @@
-/*
- * 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.serialization;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.charset.Charset;
-
-/**
- * Implementation of the {@link Serializer} interface that reads data from
- * and writes data to Java Strings.
- */
-public class StringSerializer implements Serializer<String> {
- private final Charset charset;
-
- public static final String DEFAULT_CHARSET_NAME = "UTF-8";
- public static final String TEXT_EXTENSION = "txt";
- public static final String MIME_TYPE = "text/plain";
- public static final int BUFFER_SIZE = 2048;
-
- public StringSerializer() {
- this(Charset.forName(DEFAULT_CHARSET_NAME));
- }
-
- public StringSerializer(Charset charset) {
- if (charset == null) {
- throw new IllegalArgumentException("charset is null.");
- }
-
- this.charset = charset;
- }
-
- public Charset getCharset() {
- return charset;
- }
-
- /**
- * Reads plain text data from an input stream.
- *
- * @param inputStream
- * The input stream from which data will be read.
- *
- * @return
- * An instance of {@link String} containing the text read from the input stream.
- */
- @Override
- public String readObject(InputStream inputStream) throws IOException, SerializationException {
- if (inputStream == null) {
- throw new IllegalArgumentException("inputStream is null.");
- }
-
- String result = null;
-
- try {
- BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
- ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
-
- byte[] buffer = new byte[BUFFER_SIZE];
- int read;
- while ((read = bufferedInputStream.read(buffer)) != -1) {
- byteOutputStream.write(buffer, 0, read);
- }
-
- byteOutputStream.flush();
-
- result = new String(byteOutputStream.toByteArray(), charset);
- } catch (IOException exception) {
- throw new SerializationException(exception);
- }
-
- return result;
- }
-
- /**
- * Writes plain text data to an output stream.
- *
- * @param text
- * The text to be written to the output stream.
- *
- * @param outputStream
- * The output stream to which data will be written.
- */
- @Override
- public void writeObject(String text, OutputStream outputStream)
- throws IOException, SerializationException {
- if (text == null) {
- throw new IllegalArgumentException("text is null.");
- }
-
- if (outputStream == null) {
- throw new IllegalArgumentException("outputStream is null.");
- }
-
- try {
- BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream);
- bufferedOutputStream.write(text.getBytes());
- bufferedOutputStream.flush();
- } catch (IOException exception) {
- throw new SerializationException(exception);
- }
- }
-
- @Override
- public String getMIMEType(String object) {
- return MIME_TYPE;
- }
-}
+/*
+ * 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.serialization;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.charset.Charset;
+
+/**
+ * Implementation of the {@link Serializer} interface that reads data from
+ * and writes data to Java Strings.
+ */
+public class StringSerializer implements Serializer<String> {
+ private final Charset charset;
+
+ public static final String DEFAULT_CHARSET_NAME = "UTF-8";
+ public static final String TEXT_EXTENSION = "txt";
+ public static final String MIME_TYPE = "text/plain";
+ public static final int BUFFER_SIZE = 2048;
+
+ public StringSerializer() {
+ this(Charset.forName(DEFAULT_CHARSET_NAME));
+ }
+
+ public StringSerializer(Charset charset) {
+ if (charset == null) {
+ throw new IllegalArgumentException("charset is null.");
+ }
+
+ this.charset = charset;
+ }
+
+ public Charset getCharset() {
+ return charset;
+ }
+
+ /**
+ * Reads plain text data from an input stream.
+ *
+ * @param inputStream
+ * The input stream from which data will be read.
+ *
+ * @return
+ * An instance of {@link String} containing the text read from the input stream.
+ */
+ @Override
+ public String readObject(InputStream inputStream) throws IOException, SerializationException {
+ if (inputStream == null) {
+ throw new IllegalArgumentException("inputStream is null.");
+ }
+
+ String result = null;
+
+ try {
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
+ ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
+
+ byte[] buffer = new byte[BUFFER_SIZE];
+ int read;
+ while ((read = bufferedInputStream.read(buffer)) != -1) {
+ byteOutputStream.write(buffer, 0, read);
+ }
+
+ byteOutputStream.flush();
+
+ result = new String(byteOutputStream.toByteArray(), charset);
+ } catch (IOException exception) {
+ throw new SerializationException(exception);
+ }
+
+ return result;
+ }
+
+ /**
+ * Writes plain text data to an output stream.
+ *
+ * @param text
+ * The text to be written to the output stream.
+ *
+ * @param outputStream
+ * The output stream to which data will be written.
+ */
+ @Override
+ public void writeObject(String text, OutputStream outputStream)
+ throws IOException, SerializationException {
+ if (text == null) {
+ throw new IllegalArgumentException("text is null.");
+ }
+
+ if (outputStream == null) {
+ throw new IllegalArgumentException("outputStream is null.");
+ }
+
+ try {
+ BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(outputStream);
+ bufferedOutputStream.write(text.getBytes());
+ bufferedOutputStream.flush();
+ } catch (IOException exception) {
+ throw new SerializationException(exception);
+ }
+ }
+
+ @Override
+ public String getMIMEType(String object) {
+ return MIME_TYPE;
+ }
+}
Oops, something went wrong.

0 comments on commit 70ca248

Please sign in to comment.