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> ...@@ -80,7 +80,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
@Override @Override
public void createContextMenu() { public void createContextMenu() {
} }
/*Start code for progess bar to data building- Dhanendra 17Nov2014*/ /*Start code for progess bar to data building- Dhanendra 17Nov2014*/
protected E12LoadingInterface e12LoadImg=new E12LoadingInterface(); protected E12LoadingInterface e12LoadImg=new E12LoadingInterface();
/*End code for progess bar to data building- Dhanendra 17Nov2014*/ /*End code for progess bar to data building- Dhanendra 17Nov2014*/
...@@ -142,14 +141,18 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -142,14 +141,18 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
count=rowData.size(); count=rowData.size();
for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++) for(int jDataCtr=0;jDataCtr<graphDtlList.size();jDataCtr++)
{ {
//if(jsonEachRow.get(graphDtlList.get(jDataCtr))!=null)
// {
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 //Changed By Prashant Chavan on 11-Mar-15 [For Link Chart] Start
if(graphMetaLink !=null && graphMetaLink !="") if(graphMetaLink !=null && graphMetaLink !="")
{ {
celldata = new E12CustomTextCell.CellData(0,(""+jsonEachRow.get(""+graphDtlList.get(jDataCtr))).replace('"', ' '),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 else
{ {
...@@ -162,7 +165,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -162,7 +165,6 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
rowData.put(count, celldata); rowData.put(count, celldata);
count++; count++;
} }
// }
} }
} }
celldata.setMandatory(true); celldata.setMandatory(true);
...@@ -190,18 +192,27 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -190,18 +192,27 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
graphAlignList.add(""+graphAlignMap.get(graphKey)); graphAlignList.add(""+graphAlignMap.get(graphKey));
} }
} }
String arr[] = graphLinkFormat.split("@");
graphLinkFormat = arr[0];
graphCaptionList.add(""+graphCaptioneMap.get("componentCaption"+componentId)); graphCaptionList.add(""+graphCaptioneMap.get("componentCaption"+componentId));
if(graphLinkFormat.equalsIgnoreCase("F")) //Window.alert("graphLinkFormat: "+graphLinkFormat);
{ //if(graphLinkFormat.contains("@"))
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList,graphLinkFormat); //{
} String arr[] = graphLinkFormat.split("@");
if(arr[0].equalsIgnoreCase("F"))
{
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList,graphLinkFormat);
}
else
{
flexTable.setStyleName("flexCSS");
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList);
}
/*}
else else
{ {
flexTable.setStyleName("flexCSS"); flexTable.setStyleName("flexCSS");
flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList); flexTable=createTableComponent(dataGridTableRowList,dataGridTableColList,flexTable,graphAlignList,graphCaptionList);
} }*/
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
} catch (Exception e) } catch (Exception e)
{ {
...@@ -272,29 +283,31 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -272,29 +283,31 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
{ {
firstColumn = column; firstColumn = column;
} }
sortHandler.setComparator( column , new Comparator<DataGridTableRowModel>() { sortHandler.setComparator( column , new Comparator<DataGridTableRowModel>()
{
public int compare( DataGridTableRowModel o1, DataGridTableRowModel o2 ) public int compare( DataGridTableRowModel o1, DataGridTableRowModel o2 )
{ {
if(isValidDate1(o1.getCellText( index )) && isValidDate1(o2.getCellText( index ))) if(isValidDate1(o1.getCellText( index )) && isValidDate1(o2.getCellText( index )))
{ {
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yy"); SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yy");
Date date1=null,date2=null; Date date1=null,date2=null;
try { try
{
date1 = formatter.parse(o1.getCellText( index )); date1 = formatter.parse(o1.getCellText( index ));
date2 = formatter.parse(o2.getCellText( index )); date2 = formatter.parse(o2.getCellText( index ));
} catch (Exception e) { } catch (Exception e)
{
e.printStackTrace(); e.printStackTrace();
} }
return date1.compareTo(date2); return date1.compareTo(date2);
} }
if(isValidDouble(o1.getCellText( index )) && isValidDouble(o2.getCellText( index ))) if(isValidDouble(o1.getCellText( index )) && isValidDouble(o2.getCellText( index )))
{ {
return Double.compare(Double.parseDouble(o1.getCellText( index )), Double.parseDouble(o2.getCellText( index ))); return Double.compare(Double.parseDouble(o1.getCellText( index )), Double.parseDouble(o2.getCellText( index )));
} }
else else
{ {
return o1.getCellText(index).compareTo(o2.getCellText( index )); return o1.getCellText(index).compareTo(o2.getCellText( index ));
} }
} }
}); });
...@@ -417,11 +430,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -417,11 +430,8 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
//flexTable.setHeight( Window.getClientHeight() - 240 + "px" ); //flexTable.setHeight( Window.getClientHeight() - 240 + "px" );
flexTable.setHeight("280px"); flexTable.setHeight("280px");
setHeight("280px"); setHeight("280px");
/*setHeight( Window.getClientHeight() - 207+ "px" );*/ /*setHeight( Window.getClientHeight() - 207+ "px" );*/
/*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/ /*setHeight( ( ( Window.getClientHeight() - 250 ))+ "px" );*/
addStyleName("e12AdvDataGrid-SideBars"); addStyleName("e12AdvDataGrid-SideBars");
return flexTable; return flexTable;
...@@ -535,6 +545,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -535,6 +545,7 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel>
dispFilterStatus = splitArr[2]; dispFilterStatus = splitArr[2];
if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("F")) 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")) if(linkFormat.trim().length()>0 && linkFormat.trim().equalsIgnoreCase("P"))
{ {
...@@ -544,14 +555,15 @@ public class CustomGrid extends AbstractDataGrid<DataGridTableRowModel> ...@@ -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,"", ""); 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 { 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=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) { } catch (e) {
alert("Excpeiton :: GraphComponent : createChart [" + e.message+ "]"); alert("Excpeiton :: GraphComponent : createChart [" + e.message+ "]");
......
...@@ -37,7 +37,7 @@ public class E12DashBoardPage extends Composite ...@@ -37,7 +37,7 @@ public class E12DashBoardPage extends Composite
try try
{ {
this.metaDataJsnObj = metaDataJsnObj; this.metaDataJsnObj = metaDataJsnObj;
graphComponent = new GraphComponent(parameterList,metaDataJsnObj); graphComponent = new GraphComponent(parameterList,metaDataJsnObj,"Y");
graphComponent.setWidth("100%"); graphComponent.setWidth("100%");
mainReportContainer.setWidth("100%"); mainReportContainer.setWidth("100%");
mainReportContainer.add(graphComponent); mainReportContainer.add(graphComponent);
......
...@@ -78,9 +78,11 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -78,9 +78,11 @@ public class GWTDashBoardReport implements EntryPoint
filterList =dataDtl.getFilters(metaDataJsnObj); filterList =dataDtl.getFilters(metaDataJsnObj);
int year=0; int year=0;
String month=""; String month="";
String scmMonth="";
String monthYear=""; String monthYear="";
year= 1900+date.getYear(); year= 1900+date.getYear();
month=String.valueOf(date.getMonth()+1); month=String.valueOf(date.getMonth()+1);
scmMonth=String.valueOf((date.getMonth()));
if(month.trim().length()==1) if(month.trim().length()==1)
{ {
month="0"+month; month="0"+month;
...@@ -95,7 +97,19 @@ public class GWTDashBoardReport implements EntryPoint ...@@ -95,7 +97,19 @@ public class GWTDashBoardReport implements EntryPoint
if(count==1)//if(filterInfo.getColNameId().equals("LAST_MONTH")) if(count==1)//if(filterInfo.getColNameId().equals("LAST_MONTH"))
{ {
prdFilterName=filterInfo.getColNameId(); prdFilterName=filterInfo.getColNameId();
parameterList.add(Window.Location.getParameter(filterInfo.getColNameId()) == null ? monthYear : Window.Location.getParameter(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 else
{ {
......
...@@ -23,6 +23,7 @@ import com.google.gwt.xml.client.Document; ...@@ -23,6 +23,7 @@ import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Node; import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList; import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser; import com.google.gwt.xml.client.XMLParser;
import com.google.gwt.user.client.Window;
public class InputListWidget extends Composite public class InputListWidget extends Composite
{ {
...@@ -121,25 +122,83 @@ public class InputListWidget extends Composite ...@@ -121,25 +122,83 @@ public class InputListWidget extends Composite
box.setFocus(true); 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)
{ {
String[] itmBoxArr = null; Paragraph paragraph = null;
String itmBoxValue = "";
if (itemBox.getValue() != null && !"".equals(itemBox.getValue().trim())) if (itemBox.getValue() != null && !"".equals(itemBox.getValue().trim()))
{ {
final ListItem displayItem = new ListItem(); final ListItem displayItem = new ListItem();
displayItem.setStyleName("token-input-token"); displayItem.setStyleName("token-input-token");
//Paragraph p = new Paragraph(itemBox.getValue());
//**Added new code by sachin on 20/11/14*//
itmBoxValue = itemBox.getValue(); paragraph = new Paragraph(itemBox.getValue());
itmBoxArr = itmBoxValue.split("-");
System.out.println(" spltedVlaue=" + itmBoxArr[0]);
/** End Added new code by sachin on 20/11/14 */
Paragraph p = new Paragraph(itmBoxArr[1].trim());
displayItem.addClickHandler(new ClickHandler() displayItem.addClickHandler(new ClickHandler()
{ {
public void onClick(ClickEvent clickEvent) public void onClick(ClickEvent clickEvent)
...@@ -156,9 +215,8 @@ public class InputListWidget extends Composite ...@@ -156,9 +215,8 @@ public class InputListWidget extends Composite
} }
}); });
displayItem.add(p); displayItem.add(paragraph);
displayItem.add(span); displayItem.add(span);
// hold the original value of the item selected
GWT.log("Adding selected item '" + itemBox.getValue() + "'", null); GWT.log("Adding selected item '" + itemBox.getValue() + "'", null);
itemsSelected.add(itemBox.getValue()); itemsSelected.add(itemBox.getValue());
GWT.log("Total: " + itemsSelected, null); GWT.log("Total: " + itemsSelected, null);
...@@ -167,6 +225,55 @@ public class InputListWidget extends Composite ...@@ -167,6 +225,55 @@ public class InputListWidget extends Composite
itemBox.setFocus(true); 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()))
{
final ListItem displayItem = new ListItem();
displayItem.setStyleName("token-input-token");
//Paragraph p = new Paragraph(itemBox.getValue());
//*Added new code by sachin on 20/11/14//
itmBoxValue = itemBox.getValue();
itmBoxArr = itmBoxValue.split("-");
System.out.println(" spltedVlaue=" + itmBoxArr[0]);
/** End Added new code by sachin on 20/11/14 */
Paragraph p = new Paragraph(itmBoxArr[1].trim());
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(p);
displayItem.add(span);
// hold the original value of the item selected
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 removeListItem(ListItem displayItem, BulletList list) 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