Updated Accounting Manager

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/accounting-manager@117461 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-07-24 16:16:07 +00:00
parent c22b1462e8
commit bc7542c559
14 changed files with 34 additions and 658 deletions

View File

@ -1,321 +0,0 @@
/**
* Sencha GXT 3.1.1 - Sencha for GWT
* Copyright(c) 2007-2014, Sencha, Inc.
* licensing@sencha.com
*
* http://www.sencha.com/products/gxt/license/
*/
@def borderColor value('theme.tabs.borderColor');
@def bodyBackgroundColor value('theme.tabs.bodyBackgroundColor');
/*@def cornerRadius value('theme.tabs.borderRadius', 'px');*/
@def cornerRadius 8px;
@def tabItemMarginTop 2px;
@def lastStopColor value('theme.tabs.lastStopColor');
@def headerGradient value('theme.tabs.gradient');
@def hoverGradient value('theme.tabs.hoverGradient');
@def inactiveHeaderGradient value('theme.tabs.inactiveGradient');
@def tabStripGradient value('theme.tabs.tabStripGradient');
@def headingTextColor value('theme.tabs.headingText.color');
@def headingTextSize value('theme.tabs.headingText.size');
@def headingTextWeight value('theme.tabs.headingText.weight');
@def headingTextFont value('theme.tabs.headingText.family');
@def hoverHeadingTextColor value('theme.tabs.hoverHeadingText.color');
@def hoverTextSize value('theme.tabs.hoverHeadingText.size');
@def hoverHeadingTextWeight value('theme.tabs.hoverHeadingText.weight');
@def hoverHeadingTextFont value('theme.tabs.hoverHeadingText.family');
@def activeHeadingTextColor value('theme.tabs.activeHeadingText.color');
@def activeHeadingTextSize value('theme.tabs.activeHeadingText.size');
@def activeHeadingTextWeight value('theme.tabs.activeHeadingText.weight');
@def activeHeadingTextFont value('theme.tabs.activeHeadingText.family');
@def tabLeftPadding value('theme.tabs.padding.left', 'px');
/*@def tabLeftPaddingIcon value('theme.tabs.paddingWithIcon.left', 'px');*//*extra space for icon, default to 16px for icon*/
@def tabLeftPaddingIcon 50px;
@def tabRightPadding value('theme.tabs.padding.right', 'px');
@def tabRightPaddingClosable value('theme.tabs.paddingWithClosable.right', 'px');/*extra space for close icon*/
@def tabIconLeftOffset value('theme.tabs.iconLeftOffset', 'px');
@def tabIconTopOffset value('theme.tabs.iconTopOffset', 'px');
@def scrollerBackgroundColor value('theme.tabs.scrollerBackgroundColor');
@def scrollerWidth value('theme.tabs.scrollerWidth', 'px');
/*
@def tabHeight value('theme.tabs.tabHeight', 'px');
*/
@def tabHeight 56px;
@def tabSpacing value('theme.tabs.tabSpacing', 'px');
@def tabItemBorderLeft value('theme.tabs.tabItemBorderLeft');
@def tabItemBorderTop value('theme.tabs.tabItemBorderTop');
@def tabItemBorderRight value('theme.tabs.tabItemBorderRight');
@def tabStripPaddingTop value('theme.tabs.tabStripPadding.top','px');
@def tabBarBorder value('theme.tabs.tabBarBorder');
@def tabBarBottomHeight value('theme.tabs.tabBarBottomHeight', 'px');
@def tabStripBottomBorder value('theme.tabs.tabStripBottomBorder');
@def tabBodyBorder value('theme.tabs.tabBodyBorder');
@def tabTextPadding value('theme.tabs.tabTextPadding.toString');
@def tabTexPaddingTop 16px;
.tab {
overflow: hidden;
outline: none;
}
.tabBar {
background-color: lastStopColor;
border: tabBarBorder;
overflow: hidden;
padding-bottom: tabBarBottomHeight;
}
.tabStripWrap {
background: -webkit-linear-gradient(top, tabStripGradient); /* Chrome10+,Safari5.1+ */
background: linear-gradient(to bottom, tabStripGradient); /* W3C */
width: 100%;
overflow: hidden;
position: relative;
padding-top: tabStripPaddingTop;
}
.tabStrip {
display: block;
/* widths great than this in ie8 causes north / south resize handles to have white background when tab panel put into window */
/* width: 65520px; */
whidth: auto;
float: left;
background: repeat-x bottom;
border-bottom: tabStripBottomBorder;
}
li.tabItem {
float: left;
position: relative;
margin-right: tabSpacing;
height: tabHeight;
cursor: pointer;
}
.tabStripActive.tabItem {
cursor: default;
}
.tabStrip li.tabEdge {
float: left;
margin: 0 !important;
padding: 0 !important;
border: 0 none !important;
font-size: 1px !important;
line-height: 1px !important;
overflow: hidden;
background: transparent !important;
width: 1px;
}
.tabStrip a, .tabStrip span, .tabStrip em {
display: block;
}
.tabStrip a {
text-decoration: none !important;
cursor: pointer;
outline: none;
}
.tabStripInner {
overflow: hidden;
text-overflow: ellipsis;
}
.tabStripText {
font: normal headingTextWeight headingTextSize headingTextFont;
color: headingTextColor;
white-space: nowrap;
cursor: pointer;
padding: tabTextPadding;
padding-top: tabTexPaddingTop;
}
.tabWithIcon .tabStripText {
padding-left: tabLeftPaddingIcon;
background-position: 0 3px;
background-repeat: no-repeat;
}
.tabStripActive, .tabStripActive a.tabRight {
cursor: default;
}
.tabStripOver .tabStripText {
font: normal hoverHeadingTextWeight hoverHeadingTextSize hoverHeadingTextFont;
color: hoverHeadingTextColor;
}
.tabStripActive .tabStripText {
cursor: default;
margin-bottom: -1px;
font: normal activeHeadingTextWeight activeHeadingTextSize activeHeadingTextFont;
color: activeHeadingTextColor;
}
@sprite .tabStrip .tabStripClosable a.tabStripClose {
gwt-image: "tabClose";
}
@sprite .tabStrip .tabStripClosable a.tabStripClose:hover {
gwt-image: "tabCloseOver";
}
.tabBody {
overflow: hidden;
background-color: bodyBackgroundColor;
}
.tabStripActive .tabRight {
margin-bottom: -1px;
}
.tabStripActive .tabStripText {
padding-bottom: 5px;
}
.tabStrip .tabStripClose {
display: none;
}
.tabStripClosable .tabStripClose {
background-repeat: no-repeat;
display: block;
width: 11px;
height: 11px;
position: absolute;
top: 3px;
right: 3px;
cursor: pointer;
z-index: 2;
}
.tabStripClosable .tabStripClose {
opacity: 0.6;
}
.tabStripActive .tabStripClose {
opacity: .8;
}
.tabStripClosable .tabStripClose:hover {
opacity: 1;
}
.tabBody {
border: tabBodyBorder;
border-top: 0 none;
}
.tabScrolling .tabStripWrap {
margin-left: scrollerWidth;
margin-right: scrollerWidth;
}
.tabScrolling {
position: relative;
}
.tabImage {
position: absolute;
top: tabIconTopOffset;
left: tabIconLeftOffset;
}
.tabStripOver.tabItem {
background: -webkit-linear-gradient(top, hoverGradient); /* Chrome10+,Safari5.1+ */
background: linear-gradient(to bottom, hoverGradient); /* W3C */
margin-bottom: -1px;
border-bottom: 1px solid lastStopColor;
}
.tabStripActive.tabItem {
background: -webkit-linear-gradient(top, headerGradient); /* Chrome10+,Safari5.1+ */
background: linear-gradient(to bottom, headerGradient); /* W3C */
margin-bottom: -1px;
border-bottom: 1px solid lastStopColor;
}
.tabItem {
border-top-left-radius: cornerRadius;
border-top-right-radius: cornerRadius;
border-top: tabItemBorderTop;
border-left: tabItemBorderLeft;
border-right: tabItemBorderRight;
margin-top: tabItemMarginTop;
padding-left: tabLeftPadding;
padding-right: tabRightPadding;
background: -webkit-linear-gradient(top, inactiveHeaderGradient); /* Chrome10+,Safari5.1+ */
background: linear-gradient(to bottom, inactiveHeaderGradient); /* W3C */
}
.tabItem.tabStripClosable {
padding-right: tabRightPaddingClosable;
}
@sprite .tabScrollerLeft {
gwt-image: "scrollerLeft";
width: scrollerWidth;
background-position: center;
background-color: scrollerBackgroundColor;
border: none;
position: absolute;
left: 0;
top: 0;
z-index: 10;
cursor: pointer;
}
.tabScrollerLeftOver {
opacity: .7;
}
@sprite .tabScrollerRight {
gwt-image: "scrollerRight";
width: scrollerWidth;
background-position: center;
background-color: scrollerBackgroundColor;
border: none;
position: absolute;
right: 0;
top: 0;
z-index: 10;
cursor: pointer;
}
.tabScrollerLeftDisabled, .tabScrollerRightDisabled {
cursor: default;
opacity: .7;
}
.tabScrollerRightOver {
opacity: .7;
}

View File

@ -1,11 +0,0 @@
<div class="{style.tab}">
<div class="{style.tabBar}">
<div class="{style.tabStripWrap}">
<ul class="{style.tabStrip}">
<li class="{style.tabEdge}"></li>
<div class="x-clear"></div>
</ul>
</div>
</div>
<div class="{style.tabBody}"></div>
</div>

View File

@ -1,312 +0,0 @@
package org.gcube.portlets.admin.accountingmanager.client.custom;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
import com.sencha.gxt.core.client.XTemplates;
import com.sencha.gxt.core.client.dom.XDOM;
import com.sencha.gxt.core.client.dom.XElement;
import com.sencha.gxt.core.client.resources.StyleInjectorHelper;
import com.sencha.gxt.core.client.resources.ThemeStyles;
import com.sencha.gxt.core.client.util.IconHelper;
import com.sencha.gxt.theme.neptune.client.base.tabs.Css3TabPanelAppearance.Css3TabPanelResources;
import com.sencha.gxt.widget.core.client.TabItemConfig;
import com.sencha.gxt.widget.core.client.TabPanel.TabPanelAppearance;
public class Css3BigTabPanelAppearance implements TabPanelAppearance {
public interface ItemTemplate extends XTemplates {
@XTemplate(source = "Css3BigTabPanelTabItem.html")
SafeHtml render(Css3TabPanelStyle style, TabItemConfig config);
}
public interface Css3BigTabPanelResources extends Css3TabPanelResources {
@Source("Css3BigTabPanel.css")
Css3TabPanelStyle style();
/*
ThemeDetails theme();
ImageResource tabClose();
ImageResource tabCloseOver();
ImageResource scrollerLeft();
ImageResource scrollerRight();
*/
}
public interface Css3TabPanelStyle extends com.sencha.gxt.theme.neptune.client.base.tabs.Css3TabPanelAppearance.Css3TabPanelStyle {
/** the entire tab panel */
String tab();
/** contents of the tab panel */
String tabBody();
String tabEdge();
/** tab bar, when above the body */
String tabBar();
/** icon element inside a tab item */
String tabImage();
/** the tab item itself */
String tabItem();
String tabRight();
String tabScrollerLeft();
String tabScrollerLeftDisabled();
String tabScrollerLeftOver();
String tabScrollerRight();
String tabScrollerRightDisabled();
String tabScrollerRightOver();
String tabScrolling();
String tabStrip();
/** marker on the tab item that it is active */
String tabStripActive();
/** marker on the tab item that it may be closed */
String tabStripClosable();
/** close icon within a tab item, may not be visible */
String tabStripClose();
String tabStripInner();
/** marker on the tab item that it is hovered */
String tabStripOver();
/** text element inside the tab item */
String tabStripText();
String tabStripWrap();
/** extra marker on the tab item to indicate that there is an icon */
String tabWithIcon();
}
public interface Css3TabPanelTemplates extends XTemplates {
@XTemplate(source = "Css3BigTabPanel.html")
SafeHtml render(Css3TabPanelStyle style);
}
protected ItemTemplate itemTemplate = GWT.<ItemTemplate> create(ItemTemplate.class);
protected final Css3TabPanelStyle style;
protected Css3TabPanelTemplates template;
private static final String ITEM_SELECTOR = "li";
public Css3BigTabPanelAppearance() {
this(GWT.<Css3BigTabPanelResources> create(Css3BigTabPanelResources.class));
}
public Css3BigTabPanelAppearance(Css3BigTabPanelResources resources) {
this(resources, GWT.<Css3TabPanelTemplates> create(Css3TabPanelTemplates.class));
}
public Css3BigTabPanelAppearance(Css3BigTabPanelResources resources, Css3TabPanelTemplates template) {
this.style = resources.style();
this.template = template;
StyleInjectorHelper.ensureInjected(this.style, true);
}
@Override
public void createScrollers(XElement parent) {
int h = getStripWrap(parent).getOffsetHeight();
XElement scrollLeft = getBar(parent).insertFirst("<div class='" + style.tabScrollerLeft() + "'></div>");
scrollLeft.setId(XDOM.getUniqueId());
scrollLeft.setHeight(h);
XElement scrollRight = getBar(parent).insertFirst("<div class='" + style.tabScrollerRight() + "'></div>");
scrollRight.setId(XDOM.getUniqueId());
scrollRight.setHeight(h);
}
@Override
public XElement getBar(XElement parent) {
return parent.getFirstChildElement().cast();
}
@Override
public XElement getBody(XElement parent) {
return parent.selectNode("." + style.tabBody());
}
@Override
public String getItemSelector() {
return ITEM_SELECTOR;
}
@Override
public XElement getScrollLeft(XElement parent) {
return getBar(parent).selectNode("." + style.tabScrollerLeft());
}
@Override
public XElement getScrollRight(XElement parent) {
return getBar(parent).selectNode("." + style.tabScrollerRight());
}
public XElement getStrip(XElement parent) {
return parent.selectNode("." + style.tabStrip());
}
@Override
public XElement getStripEdge(XElement parent) {
return parent.selectNode("." + style.tabEdge());
}
@Override
public XElement getStripWrap(XElement parent) {
return parent.selectNode("." + style.tabStripWrap());
}
@Override
public void insert(XElement parent, TabItemConfig config, int index) {
XElement item = XDOM.create(itemTemplate.render(style, config).asString());
item.setClassName(ThemeStyles.get().style().disabled(), !config.isEnabled());
if (config.isHTML()) {
XElement textEl = item.selectNode("." + style.tabStripText());
textEl.setInnerHTML(config.getHTML());
}
getStrip(parent).insertChild(item, index);
if (config.getIcon() != null) {
setItemIcon(item, config.getIcon());
}
if (config.isClosable()) {
item.addClassName(style.tabStripClosable());
}
}
@Override
public boolean isClose(XElement target) {
return target.is("." + style.tabStripClose());
}
@Override
public void onDeselect(Element item) {
item.removeClassName(style.tabStripActive());
}
@Override
public void onMouseOut(XElement parent, XElement target) {
NodeList<Element> nodeList = parent.select("." + style.tabStripOver());
for (int i = 0; i < nodeList.getLength(); i++) {
nodeList.getItem(i).removeClassName(style.tabStripOver());
}
if (target.is("." + style.tabScrollerLeft())) {
target.removeClassName(style.tabScrollerLeftOver());
} else if (target.is("." + style.tabScrollerRight())) {
target.removeClassName(style.tabScrollerRightOver());
}
}
@Override
public void onMouseOver(XElement parent, XElement target) {
Element item = findItem(target);
if (item != null) {
item.addClassName(style.tabStripOver());
} else if (target.is("." + style.tabScrollerLeft())) {
target.addClassName(style.tabScrollerLeftOver());
} else if (target.is("." + style.tabScrollerRight())) {
target.addClassName(style.tabScrollerRightOver());
}
}
@Override
public void onScrolling(XElement parent, boolean scrolling) {
parent.selectNode("." + style.tabBar()).setClassName(style.tabScrolling(), scrolling);
}
@Override
public void onSelect(Element item) {
item.addClassName(style.tabStripActive());
}
@Override
public void render(SafeHtmlBuilder builder) {
builder.append(template.render(style));
}
@Override
public void setItemWidth(XElement element, int width) {
XElement inner = element.selectNode("." + style.tabStripInner());
int tw = element.getOffsetWidth();
int iw = inner.getOffsetWidth();
inner.setWidth(width - (tw - iw));
}
@Override
public void updateItem(XElement item, TabItemConfig config) {
XElement textEl = item.selectNode("." + style.tabStripText());
if (config.isHTML()) {
textEl.setInnerHTML(config.getHTML());
} else {
textEl.setInnerText(config.getText());
}
setItemIcon(item, config.getIcon());
item.setClassName(ThemeStyles.get().style().disabled(), !config.isEnabled());
item.setClassName(style.tabStripClosable(), config.isClosable());
}
@Override
public void updateScrollButtons(XElement parent) {
int pos = getScrollPos(parent);
getScrollLeft(parent).setClassName(style.tabScrollerLeftDisabled(), pos == 0);
getScrollRight(parent).setClassName(style.tabScrollerRightDisabled(),
pos >= (getScrollWidth(parent) - getScrollArea(parent) - 2));
}
protected Element findItem(Element target) {
return target.<XElement> cast().findParentElement(ITEM_SELECTOR, -1);
}
protected void setItemIcon(XElement item, ImageResource icon) {
XElement node = item.selectNode("." + style.tabImage());
if (node != null) {
node.removeFromParent();
}
if (icon != null) {
Element e = IconHelper.getElement(icon);
e.setClassName(style.tabImage());
item.appendChild(e);
}
item.setClassName(style.tabWithIcon(), icon != null);
}
private int getScrollPos(XElement parent) {
return getStripWrap(parent).getScrollLeft();
}
private int getScrollArea(XElement parent) {
return Math.max(0, getStripWrap(parent).getClientWidth());
}
private int getScrollWidth(XElement parent) {
return getStripEdge(parent).getOffsetsTo(getStripWrap(parent)).getX() + getScrollPos(parent);
}
}

View File

@ -1,4 +0,0 @@
<li class="{style.tabItem}">
<a class="{style.tabStripClose}"></a>
<span class="{style.tabStripText}">{config.text}</span>
</li>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

View File

@ -16,6 +16,8 @@ import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/**
* Accounting Chart 4 Job
@ -171,8 +173,10 @@ public class AccountingChart4Job extends AccountingChartBuilder {
highchartsLayoutPanel.renderChart(options);
SimpleContainer container=new SimpleContainer();
container.add(highchartsLayoutPanel, new MarginData(0));
accountingChartPanel=new AccountingChartPanel(highchartsLayoutPanel);
accountingChartPanel=new AccountingChartPanel(container);
accountingChartSpec.setChart(accountingChartPanel);

View File

@ -16,6 +16,8 @@ import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/**
* Accounting Chart 4 Portlet
@ -171,7 +173,10 @@ public class AccountingChart4Portlet extends AccountingChartBuilder {
highchartsLayoutPanel.renderChart(options);
accountingChartPanel=new AccountingChartPanel(highchartsLayoutPanel);
SimpleContainer container=new SimpleContainer();
container.add(highchartsLayoutPanel, new MarginData(0));
accountingChartPanel=new AccountingChartPanel(container);
accountingChartSpec.setChart(accountingChartPanel);

View File

@ -15,6 +15,8 @@ import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/**
* Accounting Chart 4 Service
@ -262,7 +264,10 @@ public class AccountingChart4Service extends AccountingChartBuilder {
highchartsLayoutPanel.renderChart(options);
accountingChartPanel=new AccountingChartPanel(highchartsLayoutPanel);
SimpleContainer container=new SimpleContainer();
container.add(highchartsLayoutPanel, new MarginData(0));
accountingChartPanel=new AccountingChartPanel(container);
accountingChartSpec.setChart(accountingChartPanel);

View File

@ -15,6 +15,8 @@ import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/**
* Accounting Chart 4 Storage
@ -179,7 +181,10 @@ public class AccountingChart4Storage extends AccountingChartBuilder {
highchartsLayoutPanel.renderChart(options);
accountingChartPanel=new AccountingChartPanel(highchartsLayoutPanel);
SimpleContainer container=new SimpleContainer();
container.add(highchartsLayoutPanel, new MarginData(0));
accountingChartPanel=new AccountingChartPanel(container);
accountingChartSpec.setChart(accountingChartPanel);

View File

@ -16,6 +16,8 @@ import com.github.highcharts4gwt.model.factory.jso.JsoHighchartsOptionFactory;
import com.github.highcharts4gwt.model.highcharts.option.api.ChartOptions;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesArea;
import com.github.highcharts4gwt.model.highcharts.option.api.SeriesColumn;
import com.sencha.gxt.widget.core.client.container.MarginData;
import com.sencha.gxt.widget.core.client.container.SimpleContainer;
/**
* Accounting Chart 4 Task
@ -172,7 +174,10 @@ public class AccountingChart4Task extends AccountingChartBuilder {
highchartsLayoutPanel.renderChart(options);
accountingChartPanel=new AccountingChartPanel(highchartsLayoutPanel);
SimpleContainer container=new SimpleContainer();
container.add(highchartsLayoutPanel, new MarginData(0));
accountingChartPanel=new AccountingChartPanel(container);
accountingChartSpec.setChart(accountingChartPanel);

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.admin.accountingmanager.client.maindata.charts;
import com.google.gwt.user.client.ui.SimpleLayoutPanel;
import com.sencha.gxt.widget.core.client.container.Container;
/**
*
@ -10,18 +10,18 @@ import com.google.gwt.user.client.ui.SimpleLayoutPanel;
*/
public class AccountingChartPanel {
private SimpleLayoutPanel chart;
private Container chart;
public AccountingChartPanel(SimpleLayoutPanel chart) {
public AccountingChartPanel(Container chart) {
super();
this.chart = chart;
}
public SimpleLayoutPanel getChart() {
public Container getChart() {
return chart;
}
public void setChart(SimpleLayoutPanel chart) {
public void setChart(Container chart) {
this.chart = chart;
}