summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-01 11:18:01 (EDT)
committerEike Stepper2007-08-01 11:18:01 (EDT)
commit0f08e24e9a677d84229694198be6c5ac7ce4b47f (patch)
tree4068c2d2082c31a29d2de883234bfc19d544b96c
parentf8a0974b9e4cedd1a62c99cafdd5e7a460105eac (diff)
downloadcdo-0f08e24e9a677d84229694198be6c5ac7ce4b47f.zip
cdo-0f08e24e9a677d84229694198be6c5ac7ce4b47f.tar.gz
cdo-0f08e24e9a677d84229694198be6c5ac7ce4b47f.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorDialog.java2
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorLogDialog.java22
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java11
4 files changed, 29 insertions, 11 deletions
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorDialog.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorDialog.java
index a30ddb4..96731b1 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorDialog.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorDialog.java
@@ -53,7 +53,7 @@ public class MonitorDialog extends ProgressMonitorDialog
try
{
log = new MonitorLogDialog(getShell(), getShellStyle(), "Log of " + title, "See the log for details.", settings);
- log.setEmphasizePrefix("Woven class ");
+ log.setEmphasizePrefix("Woven class ", "Mixed in ", "Reversioned ");
super.run(fork, cancelable, new IRunnableWithProgress()
{
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorLogDialog.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorLogDialog.java
index 4882315..fc1abd9 100644
--- a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorLogDialog.java
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/ui/widgets/MonitorLogDialog.java
@@ -13,7 +13,7 @@ import org.eclipse.swt.widgets.Shell;
*/
public class MonitorLogDialog extends LogDialog implements OMMonitorHandler
{
- private String emphasizePrefix;
+ private String[] emphasizePrefix;
private TextStyle taskStyle;
@@ -38,12 +38,12 @@ public class MonitorLogDialog extends LogDialog implements OMMonitorHandler
this(parentShell, DEFAULT_SHELL_STYLE, title, message, settings);
}
- public String getEmphasizePrefix()
+ public String[] getEmphasizePrefix()
{
return emphasizePrefix;
}
- public void setEmphasizePrefix(String emphasizePrefix)
+ public void setEmphasizePrefix(String... emphasizePrefix)
{
this.emphasizePrefix = emphasizePrefix;
}
@@ -77,11 +77,21 @@ public class MonitorLogDialog extends LogDialog implements OMMonitorHandler
public void handleMessage(String msg, int level)
{
- if (msg.startsWith(emphasizePrefix))
+ boolean emphasized = false;
+ if (emphasizePrefix != null)
{
- setTextStyle(emphasizedStyle);
+ for (String prefix : emphasizePrefix)
+ {
+ if (msg.startsWith(prefix))
+ {
+ setTextStyle(emphasizedStyle);
+ emphasized = true;
+ break;
+ }
+ }
}
- else
+
+ if (!emphasized)
{
setTextStyle(normalStyle);
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
index 77161a9..b86f9d6 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOUtil.java
@@ -241,6 +241,11 @@ public final class IOUtil
*/
public static void copyFile(File source, File target) throws IORuntimeException
{
+ if (!target.getParentFile().exists())
+ {
+ target.getParentFile().mkdirs();
+ }
+
FileInputStream input = null;
FileOutputStream output = null;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
index 23167f3..831d90c 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/NIOUtil.java
@@ -39,6 +39,11 @@ public final class NIOUtil
try
{
+ if (!target.getParentFile().exists())
+ {
+ target.getParentFile().mkdirs();
+ }
+
if (!target.exists())
{
target.createNewFile();
@@ -89,8 +94,7 @@ public final class NIOUtil
// checks
if (!src.isFile() || !src.exists())
throw new IllegalArgumentException("Source file '" + src.getAbsolutePath() + "' not found!");
- if (dst.exists())
- if (dst.isDirectory()) // Directory? -> use source file name
+ if (dst.exists()) if (dst.isDirectory()) // Directory? -> use source file name
dst = new File(dst, src.getName());
else if (dst.isFile())
{
@@ -101,8 +105,7 @@ public final class NIOUtil
throw new IllegalArgumentException("Invalid destination object '" + dst.getAbsolutePath() + "'!");
File dstParent = dst.getParentFile();
if (!dstParent.exists())
- if (!dstParent.mkdirs())
- throw new IOException("Failed to create directory " + dstParent.getAbsolutePath());
+ if (!dstParent.mkdirs()) throw new IOException("Failed to create directory " + dstParent.getAbsolutePath());
long fileSize = src.length();
if (fileSize > 20971520l)
{ // for larger files (20Mb) use streams