Updated Mapping
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-widgetx@98239 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
370d18d51c
commit
80e069d1d6
|
@ -123,6 +123,10 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
|
||||
private String visibleOnlyColumn;
|
||||
|
||||
protected boolean errorNotColored=false;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param eventBus
|
||||
*/
|
||||
|
@ -384,6 +388,24 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isErrorNotColored() {
|
||||
return errorNotColored;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param errorNotColored if true set background withe for rows with error
|
||||
*/
|
||||
public void setErrorNotColored(boolean errorNotColored) {
|
||||
Log.debug("ErrorNotColored set :"+errorNotColored);
|
||||
this.errorNotColored = errorNotColored;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param columnModel
|
||||
|
@ -789,7 +811,9 @@ public class TabularDataXGridPanel extends ContentPanel {
|
|||
} else {
|
||||
Log.debug("Use default grid View");
|
||||
tableViewConfig= new TableViewConfig();
|
||||
DefaultRowStyle rowStyle=new DefaultRowStyle();
|
||||
Log.debug("Error Not Colored: "+errorNotColored);
|
||||
DefaultRowStyle rowStyle=new DefaultRowStyle(errorNotColored);
|
||||
|
||||
tableViewConfig.setRowStyleProvider(rowStyle);
|
||||
grid.getView().setViewConfig(
|
||||
new TabularDataGridViewConfig(tableViewConfig,
|
||||
|
|
|
@ -17,4 +17,6 @@ public interface ResourceBundle extends ClientBundle {
|
|||
|
||||
@Source("TDGrid.css")
|
||||
TDGridCSS tdGridCSS();
|
||||
|
||||
|
||||
}
|
|
@ -13,4 +13,7 @@ public interface TDGridCSS extends CssResource {
|
|||
|
||||
@ClassName("grid-row-red")
|
||||
public String getGridRowRed();
|
||||
|
||||
@ClassName("grid-row-no-color")
|
||||
public String getGridRowNoColor();
|
||||
}
|
||||
|
|
|
@ -18,14 +18,30 @@ import com.sencha.gxt.core.client.ValueProvider;
|
|||
*/
|
||||
public class DefaultRowStyle implements RowStyleProvider {
|
||||
|
||||
ResourceBundle res;
|
||||
protected ResourceBundle res;
|
||||
protected boolean errorNotColored;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public DefaultRowStyle() {
|
||||
res=ResourceBundle.INSTANCE;
|
||||
errorNotColored = false;
|
||||
res = ResourceBundle.INSTANCE;
|
||||
res.tdGridCSS().ensureInjected();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param errorRed
|
||||
* true if you want error rows white
|
||||
*/
|
||||
public DefaultRowStyle(boolean errorNotColored) {
|
||||
this.errorNotColored = errorNotColored;
|
||||
res = ResourceBundle.INSTANCE;
|
||||
res.tdGridCSS().ensureInjected();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRowStyle(Row row,
|
||||
|
@ -34,9 +50,13 @@ public class DefaultRowStyle implements RowStyleProvider {
|
|||
|
||||
for (ColumnDefinition c : validationColumns) {
|
||||
String valid = row.getFieldAsText(c.getColumnLocalId());
|
||||
Boolean b=new Boolean(valid);
|
||||
Boolean b = new Boolean(valid);
|
||||
if (!b) {
|
||||
if (errorNotColored) {
|
||||
style = res.tdGridCSS().getGridRowNoColor();
|
||||
} else {
|
||||
style = res.tdGridCSS().getGridRowRed();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -53,9 +73,13 @@ public class DefaultRowStyle implements RowStyleProvider {
|
|||
String style = "";
|
||||
for (ColumnDefinition c : validationColumns) {
|
||||
String valid = row.getFieldAsText(c.getColumnLocalId());
|
||||
Boolean b=new Boolean(valid);
|
||||
Boolean b = new Boolean(valid);
|
||||
if (!b) {
|
||||
if (errorNotColored) {
|
||||
style = res.tdGridCSS().getGridRowNoColor();
|
||||
} else {
|
||||
style = res.tdGridCSS().getGridRowRed();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,3 +4,6 @@
|
|||
background-color: #FF8989 !important;
|
||||
}
|
||||
|
||||
.grid-row-no-color{
|
||||
background-color: #FFFFFF !important;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue