Commit 22062bcf authored by dkasliwal's avatar dkasliwal

update src folder


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97962 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1aeba394
......@@ -80,7 +80,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
@Override
public void createContextMenu() {
}
/*Start code for progess bar to data building- Dhanendra 17Nov2014*/
protected E12LoadingInterface e12LoadImg=new E12LoadingInterface();
/*End code for progess bar to data building- Dhanendra 17Nov2014*/
......@@ -142,14 +141,18 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
count=rowData.size();
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{
//if(jsonEachRow.get(graphDtlList.get(jDataCtr))!=null)
// {
if(jsonEachRow.get(graphDtlList.get(jDataCtr))!=null)
{
//Changed By Prashant Chavan on 11-Mar-15 [For Link Chart] Start
if(graphMetaLink !=null && graphMetaLink !="")
{
/*if(graphLinkFormat !=null && graphLinkFormat !="")
{
celldata = new E12CustomTextCell.CellData(0,(""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '),graphMetaLink+"@"+graphLinkFormat);
}else
{*/
celldata = new E12CustomTextCell.CellData(0,(""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '),graphMetaLink);
//}
}
else
{
......@@ -162,7 +165,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
rowData.put(count, celldata);
count++;
}
// }
}
}
celldata.setMandatory(true);
......@@ -190,10 +192,12 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
graphAlignList.add(""+graphAlignMap.get(graphKey));
}
}
String arr[] = graphLinkFormat.split("@");
graphLinkFormat = arr[0];
graphCaptionList.add(""+graphCaptioneMap.get("componentCaption"+componentId));
if(graphLinkFormat.equalsIgnoreCase("F"))
//Window.alert("graphLinkFormat: "+graphLinkFormat);
//if(graphLinkFormat.contains("@"))
//{
String arr[] = graphLinkFormat.split("@");
if(arr[0].equalsIgnoreCase("F"))
{
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList,graphLinkFormat);
}
......@@ -202,6 +206,13 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
flexTable.setStyleName("flexCSS");
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList);
}
/*}
else
{
flexTable.setStyleName("flexCSS");
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList);
}*/
e12LoadImg.setLoading(false);
} catch (Exception e)
{
......@@ -272,18 +283,20 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{
firstColumn = column;
}
sortHandler.setComparator( column , new Comparator<DataGridTableRowModel>() {
sortHandler.setComparator( column , new Comparator<DataGridTableRowModel>()
{
public int compare( DataGridTableRowModel o1, DataGridTableRowModel o2 )
{
if(isValidDate1(o1.getCellText( index )) && isValidDate1(o2.getCellText( index )))
{
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yy");
Date date1=null,date2=null;
try {
try
{
date1 = formatter.parse(o1.getCellText( index ));
date2 = formatter.parse(o2.getCellText( index ));
} catch (Exception e) {
} catch (Exception e)
{
e.printStackTrace();
}
return date1.compareTo(date2);
......@@ -417,11 +430,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
//flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
flexTable.setHeight("280px");
setHeight("280px");
/*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
addStyleName("e12AdvDataGrid-SideBars");
return flexTable;
......@@ -535,6 +545,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
dispFilterStatus = splitArr[2];
if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("F"))
{
buildGridFrame(metadataName,cellValue, propertyStr,urlStr,parameterListString,dispFilterStatus);
}
if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("P"))
{
......@@ -544,14 +555,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{
Window.open("/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+"&CELL_VAL="+cellValue.trim()+propertyStr+"&"+parameterListString+"&FLAG="+dispFilterStatus+"&P1="+urlStr,"", "");
}*/
buildGridFrame(metadataName,cellValue, propertyStr,urlStr,parameterListString);
buildGridFrame(metadataName,cellValue, propertyStr,urlStr,parameterListString,dispFilterStatus);
}
}
private native void buildGridFrame(String metadataName,String cellValue,String propertyStr,String urlStr,String parameterListString)
private native void buildGridFrame(String metadataName,String cellValue,String propertyStr,String urlStr,String parameterListString,String dispFilterStatus)
/*-{
try {
document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='99%' height='230' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr+"&FLAG=N'></iframe>";
//document.getElementById('frameContainer').innerHTML = "<iframe scrolling='no' id='frame1' width='99%' height='230' frameborder='0' src='/ibase/dwh/GwtDashboardPage.html?metadataname="+metadataName+propertyStr+"&"+parameterListString+"&CELL_VAL="+cellValue.trim()+"&P1="+urlStr+"&FLAG="+dispFilterStatus+"'></iframe>";
} catch (e) {
alert("Excpeiton :: GraphComponent : createChart [" + e.message+ "]");
......
......@@ -37,7 +37,7 @@ public class E12DashBoardPage extends Composite
try
{
this.metaDataJsnObj = metaDataJsnObj;
graphComponent = new GraphComponent(parameterList,metaDataJsnObj);
graphComponent = new GraphComponent(parameterList,metaDataJsnObj,"Y");
graphComponent.setWidth("100%");
mainReportContainer.setWidth("100%");
mainReportContainer.add(graphComponent);
......
......@@ -78,9 +78,11 @@ public class GWTDashBoardReport implements EntryPoint
filterList =dataDtl.getFilters(metaDataJsnObj);
int year=0;
String month="";
String scmMonth="";
String monthYear="";
year= 1900+date.getYear();
month=String.valueOf(date.getMonth()+1);
scmMonth=String.valueOf((date.getMonth()));
if(month.trim().length()==1)
{
month="0"+month;
......@@ -95,8 +97,20 @@ public class GWTDashBoardReport implements EntryPoint
if(count==1)//if(filterInfo.getColNameId().equals("LAST_MONTH"))
{
prdFilterName=filterInfo.getColNameId();
if(prdFilterName=="PRD_SALESDASH")
{
if(scmMonth.trim().length()==1)
{
scmMonth="0"+scmMonth;
}
monthYear=year+scmMonth;
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(filterInfo.getColNameId()));
}
else
{
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(filterInfo.getColNameId()));
}
}
else
{
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? "" : Window.Location.getParameter(filterInfo.getColNameId()));
......
......@@ -23,6 +23,7 @@ import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
import com.google.gwt.user.client.Window;
public class InputListWidget extends Composite
{
......@@ -121,9 +122,114 @@ public class InputListWidget extends Composite
box.setFocus(true);
}
private void deselectItem(final TextBox itemBox, final BulletList list)
public InputListWidget(ArrayList<String> suggetions, HorizontalPanel popUpHPnl, SmrtFilterInfo smrtFilterInfo)
{
final BulletList list = new BulletList();
list.setTitle(smrtFilterInfo.getFltrColName());
list.setStyleName("token-input-list");
ListItem item = new ListItem();
item.setStyleName("token-input-input-token");
final TextBox itemBox = new TextBox();
itemBox.getElement().setAttribute("style", "outline-color: -moz-use-text-color; outline-style: none; outline-width: medium;");
MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
SuggestBox box = null;
for (String fltrData : suggetions)
{
oracle.add(fltrData);
}
box = new SuggestBox(oracle, itemBox);
box.getElement().setId("suggestion_box");
item.add(box);
list.add(item);
itemBox.addKeyDownHandler(new KeyDownHandler()
{
public void onKeyDown(KeyDownEvent event)
{
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
{
if (itemBox.getValue().contains("@"))
deselectItemWithoutDesc(itemBox, list);
}
// handle backspace
if (event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE)
{
if ("".equals(itemBox.getValue().trim()))
{
ListItem li = (ListItem) list.getWidget(list.getWidgetCount() - 2);
Paragraph p = (Paragraph) li.getWidget(0);
if (itemsSelected.contains(p.getText()))
{
itemsSelected.remove(p.getText());
GWT.log("Removing selected item '" + p.getText() + "'", null);
GWT.log("Remaining: " + itemsSelected, null);
}
list.remove(li);
itemBox.setFocus(true);
}
}
}
});
box.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>()
{
public void onSelection(SelectionEvent selectionEvent)
{
deselectItemWithoutDesc(itemBox, list);
}
});
popUpHPnl.add(list);
//popUpHPnl.getElement().setAttribute("onclick", "document.getElementById('suggestion_box').focus()");
box.setFocus(true);
}
private void deselectItemWithoutDesc(final TextBox itemBox, final BulletList list)
{
Paragraph paragraph = null;
if (itemBox.getValue() != null && !"".equals(itemBox.getValue().trim()))
{
String[] itmBoxArr = null;
final ListItem displayItem = new ListItem();
displayItem.setStyleName("token-input-token");
paragraph = new Paragraph(itemBox.getValue());
displayItem.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent clickEvent)
{
displayItem.addStyleName("token-input-selected-token");
}
});
Span span = new Span("x");
span.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent clickEvent)
{
removeListItem(displayItem, list);
}
});
displayItem.add(paragraph);
displayItem.add(span);
GWT.log("Adding selected item '" + itemBox.getValue() + "'", null);
itemsSelected.add(itemBox.getValue());
GWT.log("Total: " + itemsSelected, null);
list.insert(displayItem, list.getWidgetCount() - 1);
itemBox.setValue("");
itemBox.setFocus(true);
}
}
private void deselectItem(final TextBox itemBox, final BulletList list)
{ String[] itmBoxArr = null;
String itmBoxValue = "";
if (itemBox.getValue() != null && !"".equals(itemBox.getValue().trim()))
{
......@@ -132,7 +238,7 @@ public class InputListWidget extends Composite
displayItem.setStyleName("token-input-token");
//Paragraph p = new Paragraph(itemBox.getValue());
//**Added new code by sachin on 20/11/14*//
//*Added new code by sachin on 20/11/14//
itmBoxValue = itemBox.getValue();
itmBoxArr = itmBoxValue.split("-");
......@@ -166,7 +272,8 @@ public class InputListWidget extends Composite
itemBox.setValue("");
itemBox.setFocus(true);
}
}
}
private void removeListItem(ListItem displayItem, BulletList list)
{
......
/**
*
*/
package ibase.client;
/**
* @author sachin
*
*/
public class SmrtFilterInfo
{
public SmrtFilterInfo()
{
// TODO Auto-generated constructor stub
}
public String getFltrSelectnMode()
{
return fltrSelectnMode;
}
public void setFltrSelectnMode(String fltrSelectnMode)
{
this.fltrSelectnMode = fltrSelectnMode;
}
public String getFltrColName()
{
return fltrColName;
}
public void setFltrColName(String fltrColName)
{
this.fltrColName = fltrColName;
}
public String getFltrTitle()
{
return fltrTitle;
}
public void setFltrTitle(String filtrTitle)
{
this.fltrTitle = filtrTitle;
}
public String getFltrType()
{
return fltrType;
}
public void setFltrType(String filtrType)
{
this.fltrType = filtrType;
}
String fltrSelectnMode = "";
String fltrColName = "";
String fltrTitle = "";
String fltrType = "";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment