aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/cli/CommandLineOptions.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-07-10 20:15:17 +0000
committerJeremias Maerki <jeremias@apache.org>2006-07-10 20:15:17 +0000
commita383b3f433d5e577cb6fb2d851da0f28fc4a9eb3 (patch)
treecfb0c99df44c7e9604463d5563aa6fa255632e20 /src/java/org/apache/fop/cli/CommandLineOptions.java
parentdd300009bbdb72312530097d424fd9836466b6ef (diff)
downloadxmlgraphics-fop-a383b3f433d5e577cb6fb2d851da0f28fc4a9eb3.tar.gz
xmlgraphics-fop-a383b3f433d5e577cb6fb2d851da0f28fc4a9eb3.zip
Bugzilla #39983:
Moved the setting of the system look&feel to CommandLineOptions. Shouldn't really be in PreviewDialog.java. Added a parameter to createPreviewDialog() so embedders don't get a System.exit() when the user closes the preview dialog. System.exit() may only be called if the preview dialog is the main window. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@420626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/cli/CommandLineOptions.java')
-rw-r--r--src/java/org/apache/fop/cli/CommandLineOptions.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java
index fb93a060e..9fc2d5c52 100644
--- a/src/java/org/apache/fop/cli/CommandLineOptions.java
+++ b/src/java/org/apache/fop/cli/CommandLineOptions.java
@@ -25,6 +25,8 @@ import java.io.IOException;
import java.util.Locale;
import java.util.Vector;
+import javax.swing.UIManager;
+
import org.apache.fop.Version;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
@@ -153,7 +155,15 @@ public class CommandLineOptions {
inputHandler = createInputHandler();
if (MimeConstants.MIME_FOP_AWT_PREVIEW.equals(outputmode)) {
- AWTRenderer renderer = new AWTRenderer();
+ //set the system look&feel for the preview dialog
+ try {
+ if (false) UIManager.setLookAndFeel(
+ UIManager.getSystemLookAndFeelClassName());
+ } catch (Exception e) {
+ System.err.println("Couldn't set system look & feel!");
+ }
+
+ AWTRenderer renderer = new AWTRenderer(true);
renderer.setRenderable(inputHandler); //set before user agent!
renderer.setUserAgent(foUserAgent);
foUserAgent.setRendererOverride(renderer);