directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r721127 - in /directory/studio/trunk/schemaeditor/src/main: java/org/apache/directory/studio/schemaeditor/view/ resources/org/apache/directory/studio/schemaeditor/view/
Date Thu, 27 Nov 2008 09:13:14 GMT
Author: felixk
Date: Thu Nov 27 01:13:14 2008
New Revision: 721127

URL: http://svn.apache.org/viewvc?rev=721127&view=rev
Log:
Externalize Strings

Added:
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
  (with props)
    directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
  (with props)
Modified:
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/ViewUtils.java

Added: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java?rev=721127&view=auto
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
(added)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
Thu Nov 27 01:13:14 2008
@@ -0,0 +1,51 @@
+/*
+ *  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.directory.studio.schemaeditor.view;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public class Messages
+{
+    private static final String BUNDLE_NAME = "org.apache.directory.studio.schemaeditor.view.messages";
//$NON-NLS-1$
+
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME
);
+
+
+    private Messages()
+    {
+    }
+
+
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+}

Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/Messages.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/ViewUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/ViewUtils.java?rev=721127&r1=721126&r2=721127&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/ViewUtils.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/ViewUtils.java
Thu Nov 27 01:13:14 2008
@@ -79,7 +79,7 @@
      */
     public static boolean verifyName( String name )
     {
-        return name.matches( "[a-zA-Z]+[a-zA-Z0-9;-]*" ); //$NON-NLS-1$
+        return name.matches( Messages.getString( "ViewUtils.AllowedCharacters" ) ); //$NON-NLS-1$
     }
 
 

Added: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties?rev=721127&view=auto
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
(added)
+++ directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
Thu Nov 27 01:13:14 2008
@@ -0,0 +1,18 @@
+# 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.
+
+ViewUtils.AllowedCharacters=[a-zA-Z]+[a-zA-Z0-9;-]*

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/messages.properties
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message