From: <rob...@us...> - 2013-07-18 08:12:30
|
Revision: 17952 http://sourceforge.net/p/dcm4che/svn/17952 Author: robertdavid Date: 2013-07-18 08:12:23 +0000 (Thu, 18 Jul 2013) Log Message: ----------- [#WEB-892] Add 'darkroom' base-style CSS and add style selection to gui. Modified Paths: -------------- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/DashboardPanel.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/filesystem/FileSystemPanel.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/messaging/QueuePanel.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ConfigureReportPage.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/CreateOrEditReportPage.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ReportPanel.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/display/DynamicDisplayPage.java dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/systeminfo/SystemInfoPanel.java Added Paths: ----------- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/resources/org/dcm4chee/dashboard/ui/dashboard-style-r.css Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/DashboardPanel.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/DashboardPanel.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/DashboardPanel.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -38,11 +38,20 @@ package org.dcm4chee.dashboard.ui; +import org.apache.wicket.ResourceReference; +import org.apache.wicket.Session; +import org.apache.wicket.behavior.HeaderContributor; +import org.apache.wicket.markup.html.IHeaderContributor; +import org.apache.wicket.markup.html.IHeaderResponse; +import org.apache.wicket.markup.html.resources.CompressedResourceReference; +import org.apache.wicket.model.IModel; +import org.apache.wicket.model.Model; import org.dcm4chee.dashboard.ui.filesystem.FileSystemPanel; import org.dcm4chee.dashboard.ui.messaging.QueuePanel; import org.dcm4chee.dashboard.ui.report.ReportPanel; import org.dcm4chee.dashboard.ui.systeminfo.SystemInfoPanel; import org.dcm4chee.web.common.secure.SecureAjaxTabbedPanel; +import org.dcm4chee.web.common.secure.SecureSessionCheckPage; /** * @author Robert David <rob...@ag...> @@ -53,15 +62,47 @@ private static final long serialVersionUID = 1L; + private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); + public static final ResourceReference DashboardCSS_R = new CompressedResourceReference(DashboardPanel.class, "dashboard-style-r.css"); + public DashboardPanel(String id) { super(id); - + addModule(FileSystemPanel.class, null); addModule(ReportPanel.class, null); addModule(SystemInfoPanel.class, null); addModule(QueuePanel.class, null); + + add(getBaseCSSHeaderContributor()); } + public IModel<ResourceReference> getBaseCSSModel() { + + IModel<ResourceReference> cssModel = Session.get().getMetaData(SecureSessionCheckPage.BASE_CSS_MODEL_MKEY); + if (cssModel != null) { + if (cssModel.getObject().getName().equals("base-style.css")) + return new Model<ResourceReference>(DashboardPanel.DashboardCSS); + else if (cssModel.getObject().getName().equals("base-style-r.css")) + return new Model<ResourceReference>(DashboardPanel.DashboardCSS_R); + else + return cssModel; + } + return null; + + } + + public HeaderContributor getBaseCSSHeaderContributor() { + + return new HeaderContributor(new IHeaderContributor() { + + private static final long serialVersionUID = 1L; + + public void renderHead(IHeaderResponse response) { + response.renderCSSReference(getBaseCSSModel().getObject()); + } + }); + } + public static String getModuleName() { return "dashboard"; } Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/filesystem/FileSystemPanel.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/filesystem/FileSystemPanel.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/filesystem/FileSystemPanel.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -98,14 +98,11 @@ private static Logger log = LoggerFactory.getLogger(FileSystemPanel.class); - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); private static final ResourceReference CSS = new CompressedResourceReference(FileSystemPanel.class, "filesystem-style.css"); public FileSystemPanel(String id) { super(id); - if (FileSystemPanel.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(FileSystemPanel.DashboardCSS)); if (FileSystemPanel.CSS != null) add(CSSPackageResource.getHeaderContribution(FileSystemPanel.CSS)); } Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/messaging/QueuePanel.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/messaging/QueuePanel.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/messaging/QueuePanel.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -112,8 +112,6 @@ private static Logger log = LoggerFactory.getLogger(QueuePanel.class); - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); - public static final String CONNECTION_FACTORY = "java:ConnectionFactory"; private Map<String,List<QueueDepthTupel>> queueDepthConfig = new HashMap<String,List<QueueDepthTupel>>(); @@ -121,9 +119,6 @@ public QueuePanel(String id) { super(id); - if (QueuePanel.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(QueuePanel.DashboardCSS)); - try { DashboardDelegator dashboardDelegator = DashboardDelegator.getInstance((((BaseWicketApplication) getApplication()).getInitParameter("DashboardServiceName"))); Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ConfigureReportPage.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ConfigureReportPage.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ConfigureReportPage.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -91,8 +91,6 @@ private static Logger log = LoggerFactory.getLogger(ConfigureReportPage.class); - private static final ResourceReference DashboardBaseCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); - private ReportModel report; protected ModalWindow window; @@ -104,9 +102,6 @@ public ConfigureReportPage(final ModalWindow window, final ReportModel report, boolean diagram, boolean table) { super(); - if (ConfigureReportPage.DashboardBaseCSS != null) - add(CSSPackageResource.getHeaderContribution(ConfigureReportPage.DashboardBaseCSS)); - try { this.report = report; this.window = window; Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/CreateOrEditReportPage.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/CreateOrEditReportPage.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/CreateOrEditReportPage.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -97,8 +97,6 @@ private static Logger log = LoggerFactory.getLogger(CreateOrEditReportPage.class); - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); - protected ModalWindow window; private ReportModel report; @@ -109,8 +107,6 @@ public CreateOrEditReportPage(final ModalWindow window, final ReportModel report) { super(); - if (CreateOrEditReportPage.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(CreateOrEditReportPage.DashboardCSS)); this.report = (report == null) ? new ReportModel() : report; if (this.report.getGroupUuid() == null) { Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ReportPanel.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ReportPanel.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/ReportPanel.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -90,17 +90,12 @@ private static Logger log = LoggerFactory.getLogger(ReportPanel.class); - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); - private ModalWindow createGroupWindow; private ModalWindow modalWindow; public ReportPanel(String id) { super(id); - if (ReportPanel.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(ReportPanel.DashboardCSS)); - add(createGroupWindow = new ModalWindow("create-group-window") .setPageCreator(new ModalWindow.PageCreator() { Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/display/DynamicDisplayPage.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/display/DynamicDisplayPage.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/report/display/DynamicDisplayPage.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -63,13 +63,11 @@ */ public class DynamicDisplayPage extends SecureWicketPage { - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); private static final ResourceReference PrintCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-print.css"); public DynamicDisplayPage(ReportModel report, Map<String, String> parameters, boolean displayDiagram, boolean displayTable) { - if (DynamicDisplayPage.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(DynamicDisplayPage.DashboardCSS)); - if (DynamicDisplayPage.PrintCSS != null) + + if (DynamicDisplayPage.PrintCSS != null) add(CSSPackageResource.getHeaderContribution(DynamicDisplayPage.PrintCSS, "print")); add(new Label("title", report.getTitle())); Modified: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/systeminfo/SystemInfoPanel.java =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/systeminfo/SystemInfoPanel.java 2013-07-12 18:31:23 UTC (rev 17951) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/systeminfo/SystemInfoPanel.java 2013-07-18 08:12:23 UTC (rev 17952) @@ -98,19 +98,14 @@ private static Logger log = LoggerFactory.getLogger(SystemInfoPanel.class); - private static final ResourceReference DashboardCSS = new CompressedResourceReference(DashboardPanel.class, "dashboard-style.css"); - public SystemInfoPanel(String id) { super(id); - - if (SystemInfoPanel.DashboardCSS != null) - add(CSSPackageResource.getHeaderContribution(SystemInfoPanel.DashboardCSS)); } @Override public void onBeforeRender() { super.onBeforeRender(); - + try { Class<?> memoryPoolMXBean = Thread.currentThread().getContextClassLoader() .loadClass("java.lang.management.MemoryPoolMXBean"); Added: dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/resources/org/dcm4chee/dashboard/ui/dashboard-style-r.css =================================================================== --- dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/resources/org/dcm4chee/dashboard/ui/dashboard-style-r.css (rev 0) +++ dcm4chee/dcm4chee-dashboard/trunk/dcm4chee-dashboard-ui/src/main/resources/org/dcm4chee/dashboard/ui/dashboard-style-r.css 2013-07-18 08:12:23 UTC (rev 17952) @@ -0,0 +1,63 @@ +/* + Dashboard CSS +*/ + +body {font-family:font-family:Verdana,sans-serif !important} + +div.header { + background-color: #444444 !important; + color: white !important; + height: 20px !important; + text-align: left !important; + + border: thin !important; + border-width: 1px !important; + border-style: solid !important; + border-color: black !important; +} + +div.wicket-tree-table-body { + color: white !important; + background-color: #446666 !important; + border: thin !important; + border-width: 1px !important; + border-style: solid !important; + border-color: black !important; +} + +div.wicket-tree-table div.row, div.wicket-tree-table div.row-selected { + height: 25px !important; + min-height: 25px !important; +} + +div.wicket-tree-table span.icon { + background-repeat: no-repeat; + background-position: center !important; + margin-left: 2px; + margin-top: 1px; +} + +.result-message { + color: #000000; +} + +.error-message { + color: red; +} + +div.diagram-panel { + float: left; + margin: 20px; +} + +div.table-panel { + margin: 20px; +} + +span.c_ { + text-align: left; +} + +div#reportTableCell { + text-align: left; +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |