From ab3c4d0c0cf4edfd0cf5d5a78b2ea60ba30b1460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20H=C3=A5kansson?= Date: Mon, 9 Dec 2013 12:53:39 +0000 Subject: [PATCH] minor tweaks to the new ui --- e2u/src/com/googlecode/e2u/MainPage.java | 23 +++++++++---------- .../com/googlecode/e2u/ValidationView.java | 9 +++++++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/e2u/src/com/googlecode/e2u/MainPage.java b/e2u/src/com/googlecode/e2u/MainPage.java index 1692af0..6700338 100644 --- a/e2u/src/com/googlecode/e2u/MainPage.java +++ b/e2u/src/com/googlecode/e2u/MainPage.java @@ -346,11 +346,6 @@ public String getContentString(String key, Context context) throws IOException { return Messages.getString(L10nKeys.OPEN); } return buildHTML(renderView(context, getFindView()), Messages.getString(L10nKeys.OPEN), true); - } else if (!bookController.bookIsValid()) { - if (KEY_TITLE.equals(key)) { - return Messages.getString(L10nKeys.VALIDATION); - } - return buildHTML(renderView(context, bookController.getValidationView()), Messages.getString(L10nKeys.VALIDATION), false); } else if ("setup".equals(args.get("method"))) { //$NON-NLS-1$ //$NON-NLS-2$ if (KEY_TITLE.equals(key)) { return Messages.getString(L10nKeys.SETTINGS); @@ -366,12 +361,6 @@ public String getContentString(String key, Context context) throws IOException { return Messages.getString(L10nKeys.SETTINGS); } return buildHTML(renderView(context, new PaperView(setupMenu, settingsView)), Messages.getString(L10nKeys.SETTINGS), true); - } - else if ("meta".equals(args.get("method"))) { //$NON-NLS-1$ //$NON-NLS-2$ - if (KEY_TITLE.equals(key)) { - return Messages.getString(L10nKeys.ABOUT_THE_BOOK); - } - return buildHTML(renderView(context, bookController.getAboutBookView()), Messages.getString(L10nKeys.ABOUT_THE_BOOK), true); } else if ("about".equals(args.get("method"))) { if (KEY_TITLE.equals(key)) { return Messages.getString(L10nKeys.ABOUT_THE_SOFTWARE); @@ -402,7 +391,17 @@ else if ("meta".equals(args.get("method"))) { //$NON-NLS-1$ //$NON-NLS-2$ p.add(a); div.add(p); return buildHTML(div.getHTML(context).getResult(), Messages.getString(L10nKeys.TEST_SETUP), true); - } else if (device!=null && settingsView.getConfiguration().settingOK() && align!=null) { + } else if (!bookController.bookIsValid()) { + if (KEY_TITLE.equals(key)) { + return Messages.getString(L10nKeys.VALIDATION); + } + return buildHTML(renderView(context, bookController.getValidationView()), Messages.getString(L10nKeys.VALIDATION), false); + } else if ("meta".equals(args.get("method"))) { //$NON-NLS-1$ //$NON-NLS-2$ + if (KEY_TITLE.equals(key)) { + return Messages.getString(L10nKeys.ABOUT_THE_BOOK); + } + return buildHTML(renderView(context, bookController.getAboutBookView()), Messages.getString(L10nKeys.ABOUT_THE_BOOK), true); + } else if (device!=null && settingsView.getConfiguration().settingOK() && align!=null) { if ("do".equals(args.get("method"))) { //$NON-NLS-1$ //$NON-NLS-2$ if (KEY_TITLE.equals(key)) { diff --git a/e2u/src/com/googlecode/e2u/ValidationView.java b/e2u/src/com/googlecode/e2u/ValidationView.java index e09ea2a..e7ff6b8 100644 --- a/e2u/src/com/googlecode/e2u/ValidationView.java +++ b/e2u/src/com/googlecode/e2u/ValidationView.java @@ -8,6 +8,7 @@ import com.googlecode.ajui.AContainer; import com.googlecode.ajui.ALabel; +import com.googlecode.ajui.ALink; import com.googlecode.ajui.AParagraph; import com.googlecode.ajui.APre; import com.googlecode.e2u.l10n.L10nKeys; @@ -34,7 +35,7 @@ public ValidationView(Validator v) { } { AContainer div = new AContainer(); - div.setClass("overflow"); + //div.setClass("overflow"); APre pre = new APre(); InputStreamReader isr = new InputStreamReader(v.getReportStream()); int c; @@ -53,6 +54,12 @@ public ValidationView(Validator v) { } div.add(pre); add(div); + AParagraph p = new AParagraph(); + ALink a = new ALink("#"); + a.addAttribute("onclick", "window.open('book.xml','source'); return false;"); + a.add(new ALabel(Messages.getString(L10nKeys.XSLT_VIEW_SOURCE))); + p.add(a); + add(p); } } else { AParagraph p = new AParagraph();