Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Roldan Betancort2009-04-30 04:45:33 -0400
committerVictor Roldan Betancort2009-04-30 04:45:33 -0400
commit8ecfa57bb81f3a69ee70d9d631aaa6de050f173d (patch)
treeb3e4e4bad98499485b78b1c11c94d7f8decdafbe /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction
parent782ea4888abf12cbac6be73f1865b29e8aed04c3 (diff)
downloadcdo-8ecfa57bb81f3a69ee70d9d631aaa6de050f173d.tar.gz
cdo-8ecfa57bb81f3a69ee70d9d631aaa6de050f173d.tar.xz
cdo-8ecfa57bb81f3a69ee70d9d631aaa6de050f173d.zip
[272190] [UI] Externalize Strings (CDO)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=272190
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java37
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java20
4 files changed, 35 insertions, 30 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
index b0a4a81e46..e6a957feaa 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java
@@ -46,7 +46,7 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy
InternalCDOCommitContext commitContext = transaction.createCommitContext();
if (TRACER.isEnabled())
{
- TRACER.format("CDOCommitContext.preCommit");
+ TRACER.format("CDOCommitContext.preCommit"); //$NON-NLS-1$
}
commitContext.preCommit();
@@ -66,7 +66,7 @@ public class CDOSingleTransactionStrategyImpl implements CDOTransactionStrategy
if (TRACER.isEnabled())
{
- TRACER.format("CDOCommitContext.postCommit");
+ TRACER.format("CDOCommitContext.postCommit"); //$NON-NLS-1$
}
commitContext.postCommit(result);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index 0a6ba100f6..901728748d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.cdo.eresource.CDOResourceNode;
import org.eclipse.emf.cdo.eresource.EresourceFactory;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl;
+import org.eclipse.emf.cdo.messages.Messages;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta;
import org.eclipse.emf.cdo.transaction.CDOConflictResolver;
@@ -388,7 +389,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
}
else
{
- throw new CDOException("Not a ResourceFolder: " + node);
+ throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.0"), node)); //$NON-NLS-1$
}
}
@@ -495,7 +496,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
CDOID id = super.getRootOrTopLevelResourceNodeID(name);
if (getLastSavepoint().getAllDetachedObjects().containsKey(id) || getDirtyObjects().containsKey(id))
{
- throw new CDOException("Root resource node " + name + " doesn't exist");
+ throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.1"), name)); //$NON-NLS-1$
}
return id;
@@ -559,7 +560,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
checkActive();
if (hasConflict())
{
- throw new TransactionException("This transaction has conflicts");
+ throw new TransactionException(Messages.getString("CDOTransactionImpl.2")); //$NON-NLS-1$
}
if (progressMonitor == null)
@@ -823,24 +824,24 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
if (savepoint == null)
{
- throw new IllegalArgumentException("Save point is null");
+ throw new IllegalArgumentException(Messages.getString("CDOTransactionImpl.3")); //$NON-NLS-1$
}
if (savepoint.getUserTransaction() != this)
{
- throw new IllegalArgumentException("Save point to rollback doesn't belong to this transaction: " + savepoint);
+ throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOTransactionImpl.4"), savepoint)); //$NON-NLS-1$
}
if (TRACER.isEnabled())
{
- TRACER.trace("handleRollback()");
+ TRACER.trace("handleRollback()"); //$NON-NLS-1$
}
try
{
if (!savepoint.isValid())
{
- throw new IllegalArgumentException("Savepoint isn't valid : " + savepoint);
+ throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOTransactionImpl.6"), savepoint)); //$NON-NLS-1$
}
// Use the state lock since rollback mechanism is playing with EObject and CDORevisions. We do not want to
@@ -931,14 +932,14 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
public String toString()
{
- return MessageFormat.format("CDOTransaction({0})", getViewID());
+ return MessageFormat.format("CDOTransaction({0})", getViewID()); //$NON-NLS-1$
}
public void registerNew(InternalCDOObject object)
{
if (TRACER.isEnabled())
{
- TRACER.format("Registering new object {0}", object);
+ TRACER.format("Registering new object {0}", object); //$NON-NLS-1$
}
registerNewPackage(object.eClass().getEPackage());
@@ -1015,7 +1016,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
if (TRACER.isEnabled())
{
- TRACER.format("Registering dirty object {0}", object);
+ TRACER.format("Registering dirty object {0}", object); //$NON-NLS-1$
}
if (featureDelta != null)
@@ -1035,7 +1036,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
Object old = map.put(object.cdoID(), object);
if (old != null)
{
- throw new ImplementationError("Duplicate ID: " + object);
+ throw new ImplementationError(MessageFormat.format(Messages.getString("CDOTransactionImpl.10"), object)); //$NON-NLS-1$
}
if (!dirty)
@@ -1101,7 +1102,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
CDOPackageUnit packageUnit = packageRegistry.getPackageUnit(usedPackage);
if (packageUnit == null)
{
- throw new CDOException("No package unit for " + usedPackage);
+ throw new CDOException(MessageFormat.format(Messages.getString("CDOTransactionImpl.11"), usedPackage)); //$NON-NLS-1$
}
if (packageUnit.getState() == CDOPackageUnit.State.NEW)
@@ -1249,7 +1250,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
if (TRACER.isEnabled())
{
- TRACER.trace("commit()");
+ TRACER.trace("commit()"); //$NON-NLS-1$
}
for (CDOTransactionHandler handler : getHandlers())
@@ -1393,7 +1394,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
public String toString()
{
- return MessageFormat.format("CDOTransactionStartedEvent[source={0}]", getSource());
+ return MessageFormat.format("CDOTransactionStartedEvent[source={0}]", getSource()); //$NON-NLS-1$
}
}
@@ -1427,7 +1428,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
public String toString()
{
- return MessageFormat.format("CDOTransactionFinishedEvent[source={0}, type={1}, idMappings={2}]", getSource(),
+ return MessageFormat.format("CDOTransactionFinishedEvent[source={0}, type={1}, idMappings={2}]", getSource(), //$NON-NLS-1$
getType(), idMappings == null ? 0 : idMappings.size());
}
}
@@ -1462,7 +1463,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
public String toString()
{
- return MessageFormat.format("CDOTransactionConflictEvent[source={0}, conflictingObject={1}, firstConflict={2}]",
+ return MessageFormat.format("CDOTransactionConflictEvent[source={0}, conflictingObject={1}, firstConflict={2}]", //$NON-NLS-1$
getSource(), getConflictingObject(), isFirstConflict());
}
}
@@ -1497,7 +1498,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
@Override
public String toString()
{
- return MessageFormat.format("CDOViewResourcesEvent[source={0}, {1}={2}]", getSource(), resourcePath, kind);
+ return MessageFormat.format("CDOViewResourcesEvent[source={0}, {1}={2}]", getSource(), resourcePath, kind); //$NON-NLS-1$
}
}
@@ -1601,7 +1602,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
if (resolver.getTransaction() != null)
{
- throw new IllegalArgumentException("New conflict resolver is already associated with a transaction");
+ throw new IllegalArgumentException(Messages.getString("CDOTransactionImpl.17")); //$NON-NLS-1$
}
resolver.setTransaction(CDOTransactionImpl.this);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
index 636fc9b1ad..b3d08602d8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.common.revision.CDOReferenceAdjuster;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl;
+import org.eclipse.emf.cdo.messages.Messages;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.transaction.CDOXATransactionImpl.CDOXAState;
@@ -32,6 +33,7 @@ import org.eclipse.emf.spi.cdo.InternalCDOXATransaction.InternalCDOXACommitConte
import org.eclipse.core.runtime.IProgressMonitor;
+import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -158,7 +160,7 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
}
else
{
- throw new ImplementationError("Object should be an EObject " + idOrObject);
+ throw new ImplementationError(MessageFormat.format(Messages.getString("CDOXACommitContextImpl.0"), idOrObject)); //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
index a289e23416..e27c4189ca 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.internal.cdo.transaction;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.messages.Messages;
import org.eclipse.emf.cdo.transaction.CDOSavepoint;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.transaction.CDOXATransaction;
@@ -39,6 +40,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -131,7 +133,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
CDOXATransaction transSet = CDOUtil.getXATransaction(viewSet);
if (transSet != null)
{
- throw new IllegalArgumentException("XATransaction is already attached to this viewSet");
+ throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.0")); //$NON-NLS-1$
}
viewSet.eAdapters().add(internalAdapter);
@@ -147,7 +149,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
CDOXATransaction transSet = CDOUtil.getXATransaction(viewSet);
if (transSet != this)
{
- throw new IllegalArgumentException("ViewSet isn't attached to this XATransaction");
+ throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.1")); //$NON-NLS-1$
}
for (InternalCDOTransaction transaction : getTransactions(viewSet))
@@ -187,7 +189,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
private void send(Collection<CDOXACommitContextImpl> xaContexts, final IProgressMonitor progressMonitor)
throws InterruptedException, ExecutionException
{
- progressMonitor.beginTask("", xaContexts.size());
+ progressMonitor.beginTask("", xaContexts.size()); //$NON-NLS-1$
try
{
@@ -252,8 +254,8 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
public void commit(IProgressMonitor progressMonitor) throws TransactionException
{
- CheckUtil.checkArg(progressMonitor, "progressMonitor");
- progressMonitor.beginTask("Committing XA transaction", 3);
+ CheckUtil.checkArg(progressMonitor, "progressMonitor"); //$NON-NLS-1$
+ progressMonitor.beginTask(Messages.getString("CDOXATransactionImpl.4"), 3); //$NON-NLS-1$
int phase = 0;
for (InternalCDOTransaction transaction : transactions)
@@ -318,17 +320,17 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
{
if (savepoint == null)
{
- throw new IllegalArgumentException("Save point is null");
+ throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.5")); //$NON-NLS-1$
}
if (savepoint.getUserTransaction() != this)
{
- throw new IllegalArgumentException("Save point to rollback doesn't belong to this transaction: " + savepoint);
+ throw new IllegalArgumentException(MessageFormat.format(Messages.getString("CDOXATransactionImpl.6"), savepoint)); //$NON-NLS-1$
}
if (!savepoint.isValid())
{
- throw new IllegalArgumentException("Savepoint isn't valid : " + savepoint);
+ throw new IllegalArgumentException(Messages.getString("CDOXATransactionImpl.7") + savepoint); //$NON-NLS-1$
}
CDOXASavepointImpl savepointSet = (CDOXASavepointImpl)savepoint;
@@ -406,7 +408,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
{
if (!allRequestEnabled)
{
- throw new IllegalStateException("Commit from CDOTransaction is not allowed.");
+ throw new IllegalStateException(Messages.getString("CDOXATransactionImpl.8")); //$NON-NLS-1$
}
}

Back to the top