Author: sflanigan
Date: 2009-04-07 03:15:51 -0400 (Tue, 07 Apr 2009)
New Revision: 14537
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIMessages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages.properties
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/DecoratorTextPreferencesPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/MainPreferencePage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
Log:
JBIDE-3557 Externalise English strings - converted ModelUIMessages to new-style Eclipse
message bundle; shortened some property keys; fixed some typos in English text.
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIMessages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIMessages.java 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIMessages.java 2009-04-07
07:15:51 UTC (rev 14537)
@@ -7,39 +7,51 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.common.model.ui;
-import java.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
+import org.eclipse.osgi.util.NLS;
-/**
- * @author Aleksey
- */
-public class ModelUIMessages {
+public final class ModelUIMessages extends NLS {
- private static final String RESOURCE_BUNDLE=
"org.jboss.tools.common.model.ui.messages";
+ private static final String BUNDLE_NAME =
"org.jboss.tools.common.model.ui.messages";//$NON-NLS-1$
- private static ResourceBundle resourceBundle=
ResourceBundle.getBundle(RESOURCE_BUNDLE);
-
private ModelUIMessages() {
+ // Do not instantiate
}
- public static String getString(String key) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "%" + key + "%";
- }
- }
+ public static String DecoratorTextPreferencesPage_AddVariable;
+ public static String DecoratorTextPreferencesPage_Decorator;
+ public static String DecoratorTextPreferencesPage_DefaultLabel;
+ public static String DecoratorTextPreferencesPage_Format;
+ public static String DecoratorTextPreferencesPage_Preview;
+ public static String DecoratorTextPreferencesPage_SelectVariable;
+ public static String DecoratorTextPreferencesPage_Text;
+ public static String ResourceLayoutManager_ERROR_RESOURCE_NULL;
+ public static String ResourceLayoutManager_ERROR_CREATE_DOCUMENT;
+ public static String ResourceLayoutManager_WARNING_HEAD_EMPTY;
+ public static String ResourceLayoutManager_ERROR_ANOTHER_HEAD;
+ public static String ResourceLayoutManager_ERROR_UNKNOWN_EXCEPTION;
+ public static String Editor_Cut_label;
+ public static String Editor_Cut_tooltip;
+ public static String Editor_Cut_image;
+ public static String Editor_Cut_description;
+ public static String Editor_Copy_label;
+ public static String Editor_Copy_tooltip;
+ public static String Editor_Copy_image;
+ public static String Editor_Copy_description;
+ public static String Editor_Paste_label;
+ public static String Editor_Paste_tooltip;
+ public static String Editor_Paste_image;
+ public static String Editor_Paste_description;
+ public static String Editor_Delete_label;
+ public static String Editor_Delete_tooltip;
+ public static String Editor_Delete_image;
+ public static String Editor_Delete_description;
+ public static String MainPreferencePage_Description;
+ public static String Form_CANNOT_LOAD_ATTRIBUTE;
- public static String getString(String key, String[] args) {
- return MessageFormat.format(getString(key), args);
- }
-
- public static ResourceBundle getResourceBundle() {
- return resourceBundle;
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, ModelUIMessages.class);
}
-
-}
+}
\ No newline at end of file
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Form.java 2009-04-07
07:15:51 UTC (rev 14537)
@@ -16,6 +16,7 @@
import java.util.Iterator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -41,8 +42,6 @@
*/
public class Form extends ExpandableForm {
- private static final String CANNOT_LOAD_ATTRIBUTE =
"org.jboss.tools.common.model.ui.forms.Form.CANNOT_LOAD_ATTRIBUTE";
-
private XAttributeSupport support;
private XModelObject xmo;
// private XModel model;
@@ -152,7 +151,7 @@
support.registerFieldEditor(editor.getAttributeName(),
(ExtendedFieldEditor)fieldEditor);
}
} else {
- ModelUIPlugin.getPluginLog().logInfo(
ModelUIMessages.getString(CANNOT_LOAD_ATTRIBUTE, new String[]
{attributes[i].getName()}));
+ ModelUIPlugin.getPluginLog().logInfo(
NLS.bind(ModelUIMessages.Form_CANNOT_LOAD_ATTRIBUTE, attributes[i].getName()));
}
}
} else {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages.properties
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages.properties 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/messages.properties 2009-04-07
07:15:51 UTC (rev 14537)
@@ -1,36 +1,40 @@
-DecoratorTextPreferencesPage.AddVariable=Add Variable...
-DecoratorTextPreferencesPage.Decorator=Select decorator:
-DecoratorTextPreferencesPage.DefaultLabel=?
-DecoratorTextPreferencesPage.Format=Format:
-DecoratorTextPreferencesPage.Preview=Preview:
-DecoratorTextPreferencesPage.SelectVariable=Select Variable
-DecoratorTextPreferencesPage.Text=Text
-org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_RESOURCE_NULL =
Resource paramener cannot be null.
-org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_CREATE_DOCUMENT =
Cannot create new layout XML document \"{0}\" for resource \"{1}\".
-org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.WARNING_HEAD_EMPTY =
Empty head tag in layout \"{0}\".
-org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_ANOTHER_HEAD =
Layout \"{0}\" from another resource \"{1}\".
-org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_UNKNOW_EXCEPTION =
Unknow Exception.
+DecoratorTextPreferencesPage_AddVariable=Add Variable...
+DecoratorTextPreferencesPage_Decorator=Select decorator:
+DecoratorTextPreferencesPage_DefaultLabel=?
+DecoratorTextPreferencesPage_Format=Format:
+DecoratorTextPreferencesPage_Preview=Preview:
+DecoratorTextPreferencesPage_SelectVariable=Select Variable
+DecoratorTextPreferencesPage_Text=Text
+ResourceLayoutManager_ERROR_RESOURCE_NULL = Resource parameter cannot be null.
+ResourceLayoutManager_ERROR_CREATE_DOCUMENT = Cannot create new layout XML document
\"{0}\" for resource \"{1}\".
+ResourceLayoutManager_WARNING_HEAD_EMPTY = Empty head tag in layout \"{0}\".
+# START NON-TRANSLATABLE
+# String only referenced in dead code.
+# The corresponding exception is never thrown in the current code.
+# (Besides which, the {0} and {1} parameters are not passed in.)
+ResourceLayoutManager_ERROR_ANOTHER_HEAD = Layout \"{0}\" from another resource
\"{1}\".
+# END NON-TRANSLATABLE
+ResourceLayoutManager_ERROR_UNKNOWN_EXCEPTION = Unknown Exception.
-Editor.Cut.label=Cu&t
-Editor.Cut.tooltip=Cut
-Editor.Cut.image=
-Editor.Cut.description=Cut
+Editor_Cut_label=Cu&t
+Editor_Cut_tooltip=Cut
+Editor_Cut_image=
+Editor_Cut_description=Cut
-Editor.Copy.label=&Copy
-Editor.Copy.tooltip=Copy
-Editor.Copy.image=
-Editor.Copy.description=Copy
+Editor_Copy_label=&Copy
+Editor_Copy_tooltip=Copy
+Editor_Copy_image=
+Editor_Copy_description=Copy
-Editor.Paste.label=&Paste
-Editor.Paste.tooltip=Paste
-Editor.Paste.image=
-Editor.Paste.description=Paste
+Editor_Paste_label=&Paste
+Editor_Paste_tooltip=Paste
+Editor_Paste_image=
+Editor_Paste_description=Paste
-Editor.Delete.label=&Delete
-Editor.Delete.tooltip=Delete
-Editor.Delete.image=
-Editor.Delete.description=Delete
-MainPreferencePage.Description=JBossTools preferences
+Editor_Delete_label=&Delete
+Editor_Delete_tooltip=Delete
+Editor_Delete_image=
+Editor_Delete_description=Delete
+MainPreferencePage_Description=JBossTools preferences
-org.jboss.tools.common.model.ui.forms.Form.CANNOT_LOAD_ATTRIBUTE = Cannot load attribute
\"{0}\" from model.
-
+Form_CANNOT_LOAD_ATTRIBUTE= Cannot load attribute \"{0}\" from model.
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/DecoratorTextPreferencesPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/DecoratorTextPreferencesPage.java 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/DecoratorTextPreferencesPage.java 2009-04-07
07:15:51 UTC (rev 14537)
@@ -69,7 +69,7 @@
Map<XModelObjectDecorator,String> currentValues = new
HashMap<XModelObjectDecorator, String>();
public DecoratorTextPreferencesPage() {
- setTitle(ModelUIMessages.getString("DecoratorTextPreferencesPage.Text"));
//$NON-NLS-1$
+ setTitle(ModelUIMessages.DecoratorTextPreferencesPage_Text);
}
@Override
@@ -79,7 +79,7 @@
g.setLayout(new GridLayout(1, false));
Label label = new Label(g, SWT.NONE);
- label.setText(ModelUIMessages.getString("DecoratorTextPreferencesPage.Decorator"));
//$NON-NLS-1$
+ label.setText(ModelUIMessages.DecoratorTextPreferencesPage_Decorator);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
decorators = new TreeViewer(g, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
@@ -169,13 +169,13 @@
c.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label cLabel = new Label(c, SWT.NONE);
- cLabel.setText(ModelUIMessages.getString("DecoratorTextPreferencesPage.Format"));
//$NON-NLS-1$
+ cLabel.setText(ModelUIMessages.DecoratorTextPreferencesPage_Format);
formatField = new Text(c, SWT.SINGLE | SWT.BORDER);
formatField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addVariableButton = new Button(c, SWT.PUSH);
- addVariableButton.setText(ModelUIMessages.getString("DecoratorTextPreferencesPage.AddVariable"));
//$NON-NLS-1$
+ addVariableButton.setText(ModelUIMessages.DecoratorTextPreferencesPage_AddVariable);
addVariableButton.addSelectionListener(new SelectionListener() {
@@ -191,7 +191,7 @@
label = new Label(g, SWT.NONE);
- label.setText(ModelUIMessages.getString("DecoratorTextPreferencesPage.Preview"));
//$NON-NLS-1$
+ label.setText(ModelUIMessages.DecoratorTextPreferencesPage_Preview);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
examples = new TreeViewer(g, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
examples.setContentProvider(new ITreeContentProvider() {
@@ -229,7 +229,7 @@
d.setValue(formatField.getText());
result = d.getLabel(modelObject);
} else {
- result =
ModelUIMessages.getString("DecoratorTextPreferencesPage.DefaultLabel");
//$NON-NLS-1$
+ result = ModelUIMessages.DecoratorTextPreferencesPage_DefaultLabel;
}
return result;
}
@@ -367,7 +367,7 @@
}
);
dialog.setInput(selection);
- dialog.setTitle(ModelUIMessages.getString("DecoratorTextPreferencesPage.SelectVariable"));
//$NON-NLS-1$
+ dialog.setTitle(ModelUIMessages.DecoratorTextPreferencesPage_SelectVariable);
dialog.create();
int result = dialog.open();
if(result == Window.OK) {
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/MainPreferencePage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/MainPreferencePage.java 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/preferences/MainPreferencePage.java 2009-04-07
07:15:51 UTC (rev 14537)
@@ -40,13 +40,13 @@
public class MainPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
- public static final String ID =
"org.jboss.tools.common.model.ui.MainPreferencePage";
+ public static final String ID =
"org.jboss.tools.common.model.ui.MainPreferencePage"; //$NON-NLS-1$
private Image image;
/** Default constructor */
public MainPreferencePage() {
- this.setDescription(ModelUIMessages.getString("MainPreferencePage.Description"));
//$NON-NLS-1$
+ this.setDescription(ModelUIMessages.MainPreferencePage_Description);
}
/** Description of the Method */
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2009-04-07
06:05:59 UTC (rev 14536)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/resources/ResourceLayoutManager.java 2009-04-07
07:15:51 UTC (rev 14537)
@@ -29,6 +29,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.osgi.util.NLS;
import org.jboss.tools.common.model.ui.ModelUIMessages;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.xml.SafeDocumentBuilderFactory;
@@ -44,19 +45,13 @@
public class ResourceLayoutManager {
// public
- public static final String ROOT_TAG = "Layout";
- public static final String RESOURCE_ATTR = "resource";
- public static final String LAYOUT_EXT = "l4t";
- public static final String LAYOUT_PROPERTY = "layout";
+ public static final String ROOT_TAG = "Layout"; //$NON-NLS-1$
+ public static final String RESOURCE_ATTR = "resource"; //$NON-NLS-1$
+ public static final String LAYOUT_EXT = "l4t"; //$NON-NLS-1$
+ public static final String LAYOUT_PROPERTY = "layout"; //$NON-NLS-1$
// static
private static ResourceLayoutManager instance;
- private static final String ERROR_UNKNOW_EXCEPTION =
"org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_UNKNOW_EXCEPTION";
- private static final String ERROR_RESOURCE_NULL =
"org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_RESOURCE_NULL";
- private static final String ERROR_CREATE_DOCUMENT =
"org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_CREATE_DOCUMENT";
- private static final String WARNING_EMPTY_HEAD =
"org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.WARNING_HEAD_EMPTY";
- private static final String ERROR_ANOTHER_HEAD =
"org.jboss.tools.common.model.ui.resources.ResourceLayoutManager.ERROR_ANOTHER_HEAD";
-
// documents hash, key == fullPathToResource, value == document
private HashMap<String,Document> hashMap = new HashMap<String,Document>();
@@ -93,7 +88,7 @@
private Document getLayoutDocument(IResource resource) {
Document document = null;
if (resource == null) {
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_RESOURCE_NULL));
+ ModelUIPlugin.getPluginLog().logError(ModelUIMessages.ResourceLayoutManager_ERROR_RESOURCE_NULL);
return null;
}
@@ -101,7 +96,7 @@
String layoutLocation = null;
try {
if(resource.isAccessible()) {
- layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY));
+ layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY)); //$NON-NLS-1$
}
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
@@ -117,13 +112,13 @@
try {
document = loadDocument(resource);
} catch (ParserConfigurationException e) {
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_UNKNOW_EXCEPTION),
e);
+ ModelUIPlugin.getPluginLog().logError(ModelUIMessages.ResourceLayoutManager_ERROR_UNKNOWN_EXCEPTION,
e);
} catch (SAXException e) {
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_UNKNOW_EXCEPTION),
e);
+ ModelUIPlugin.getPluginLog().logError(ModelUIMessages.ResourceLayoutManager_ERROR_UNKNOWN_EXCEPTION,
e);
} catch (IOException e) {
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_UNKNOW_EXCEPTION),
e);
+ ModelUIPlugin.getPluginLog().logError(ModelUIMessages.ResourceLayoutManager_ERROR_UNKNOWN_EXCEPTION,
e);
} catch (AnotherResourceException e) {
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_ANOTHER_HEAD),
e);
+ ModelUIPlugin.getPluginLog().logError(ModelUIMessages.ResourceLayoutManager_ERROR_ANOTHER_HEAD,
e);
}
if (document!=null){
hashMap.put(fullResourceLocation, document);
@@ -135,7 +130,7 @@
document = createNewDocument(resource);
} catch (ParserConfigurationException e) {
//log(Status.ERROR, ModelUIMessages.getString(ERROR_CREATE_DOCUMENT, new String[]
{fullLayoutLocation, fullResourceLocation}));
- ModelUIPlugin.getPluginLog().logError(
ModelUIMessages.getString(ERROR_CREATE_DOCUMENT, new String[] {layoutLocation,
fullResourceLocation}));
+ ModelUIPlugin.getPluginLog().logError(
NLS.bind(ModelUIMessages.ResourceLayoutManager_ERROR_CREATE_DOCUMENT, layoutLocation,
fullResourceLocation));
}
if (document!=null){
hashMap.put(fullResourceLocation, document);
@@ -163,7 +158,7 @@
String layoutLocation = null;
try {
if(resource != null && resource.isAccessible()) {
- layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY));
+ layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY)); //$NON-NLS-1$
}
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
@@ -184,7 +179,7 @@
if (nodeList==null || nodeList.getLength()==0 || nodeList.item(0)==null) {
// warning
//log(ModelUIMessages.getString(WARNING_EMPTY_HEAD, new String[]
{fullLayoutLocation}));
- ModelUIPlugin.getPluginLog().logInfo(ModelUIMessages.getString(WARNING_EMPTY_HEAD,
new String[] {layoutLocation}));
+ ModelUIPlugin.getPluginLog().logInfo(NLS.bind(ModelUIMessages.ResourceLayoutManager_WARNING_HEAD_EMPTY,
layoutLocation));
// create new head
createRoot(resource, document);
} /*else {
@@ -211,7 +206,7 @@
String layoutLocation = null;
try {
if(resource != null && resource.isAccessible()) {
- layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY));
+ layoutLocation = resource.getPersistentProperty(new
QualifiedName("",LAYOUT_PROPERTY)); //$NON-NLS-1$
}
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);
@@ -231,20 +226,20 @@
try {
//FileWriter writer = new FileWriter(fullLayoutLocation);
FileWriter writer = new FileWriter(layoutLocation);
- XMLSerializer serial = new XMLSerializer(writer,
createOutputFormat("UTF-8"));
+ XMLSerializer serial = new XMLSerializer(writer,
createOutputFormat("UTF-8")); //$NON-NLS-1$
serial.asDOMSerializer();
serial.serialize(document);
writer.close();
} catch (IOException e) {
//log(Status.ERROR, ModelUIMessages.getString(ERROR_CREATE_DOCUMENT, new String[]
{fullLayoutLocation, fullResourceLocation}), e);
- ModelUIPlugin.getPluginLog().logError(ModelUIMessages.getString(ERROR_CREATE_DOCUMENT,
new String[] {layoutLocation, fullResourceLocation}), e);
+ ModelUIPlugin.getPluginLog().logError(NLS.bind(ModelUIMessages.ResourceLayoutManager_ERROR_CREATE_DOCUMENT,
layoutLocation, fullResourceLocation), e);
}
}
private OutputFormat createOutputFormat(String encoding) {
- if(encoding == null || encoding.length() == 0) encoding = "UTF-8";
+ if(encoding == null || encoding.length() == 0) encoding = "UTF-8";
//$NON-NLS-1$
OutputFormat format = new OutputFormat(Method.XML, encoding, true);
- format.setLineSeparator(System.getProperty("line.separator",
LineSeparator.Web));
+ format.setLineSeparator(System.getProperty("line.separator",
LineSeparator.Web)); //$NON-NLS-1$
format.setIndent(1);
return format;
}
@@ -266,12 +261,12 @@
}
private String createNewLayoutLocation(IResource resource) {
- String fileName =
resource.getProject().getName()+"_"+resource.getName()+"_"+System.currentTimeMillis();
+ String fileName =
resource.getProject().getName()+"_"+resource.getName()+"_"+System.currentTimeMillis();
//$NON-NLS-1$//$NON-NLS-2$
String layoutLocation = getPluginMetadataPath().toString();
- String result = layoutLocation+"/"+fileName+"."+LAYOUT_EXT;
+ String result = layoutLocation+"/"+fileName+"."+LAYOUT_EXT;
//$NON-NLS-1$//$NON-NLS-2$
try {
if(resource != null && resource.isAccessible()) {
- resource.setPersistentProperty(new QualifiedName("", LAYOUT_PROPERTY),
result);
+ resource.setPersistentProperty(new QualifiedName("", LAYOUT_PROPERTY),
result); //$NON-NLS-1$
}
} catch (CoreException e) {
ModelUIPlugin.getPluginLog().logError(e);