_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q178600
SaveAttrsUtility.parseSaveAttrString
test
public static String parseSaveAttrString(final String strValue) { if (strValue != null) { int first = strValue.indexOf(TieConstants.METHOD_PREFIX); int last = strValue.lastIndexOf(TieConstants.METHOD_PREFIX); int end = strValue.lastIndexOf(TieConstants.METHOD_END); if ((first >= 0) && (first == last)...
java
{ "resource": "" }
q178601
SaveAttrsUtility.getSaveAttrListFromRow
test
public static String getSaveAttrListFromRow(final Row row) { if (row != null) { Cell cell = row.getCell(TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN); if (cell != null) { String str = cell.getStringCellValue(); if ((str != null) && (!str.isEmpty())) { return str; } } } return null; ...
java
{ "resource": "" }
q178602
SaveAttrsUtility.getSaveAttrFromList
test
public static String getSaveAttrFromList(final int columnIndex, final String saveAttrs) { if ((saveAttrs != null) && (!saveAttrs.isEmpty())) { String str = TieConstants.CELL_ADDR_PRE_FIX + columnIndex + "="; int istart = saveAttrs.indexOf(str); if (istart >= 0) { int iend = saveAttrs.indexOf(',', is...
java
{ "resource": "" }
q178603
SaveAttrsUtility.setSaveObjectsInHiddenColumn
test
public static void setSaveObjectsInHiddenColumn(final Row row, final String saveAttr) { Cell cell = row.getCell(TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(saveAttr); }
java
{ "resource": "" }
q178604
SaveAttrsUtility.setSaveAttrsForSheet
test
public static void setSaveAttrsForSheet(final Sheet sheet, final int minRowNum, final int maxRowNum, final Map<String, String> saveCommentsMap) { for (Row row : sheet) { int rowIndex = row.getRowNum(); if ((rowIndex >= minRowNum) && (rowIndex <= maxRowNum)) { setSaveAttrsForRow(row, saveCommentsMa...
java
{ "resource": "" }
q178605
SaveAttrsUtility.setSaveAttrsForRow
test
public static void setSaveAttrsForRow(final Row row, final Map<String, String> saveCommentsMap) { StringBuilder saveAttr = new StringBuilder(); for (Cell cell : row) { String sAttr = parseSaveAttr(cell, saveCommentsMap); if (!sAttr.isEmpty()) { saveAttr.append(sAttr); } } if (saveAttr.lengt...
java
{ "resource": "" }
q178606
SaveAttrsUtility.prepareContextAndAttrsForCell
test
public static String prepareContextAndAttrsForCell(Cell poiCell, String fullName, CellHelper cellHelper) { if (fullName == null) { return null; } String saveAttrList = SaveAttrsUtility.getSaveAttrListFromRow(poiCell.getRow()); if (saveAttrList != null) { String saveAttr = SaveAttrsUtility.getSaveA...
java
{ "resource": "" }
q178607
TieSheetNumberConverter.fmtNumber
test
private String fmtNumber(final double d) { if (Double.compare(d % 1, 0) == 0) { return String.format("%d", (int) d); } else { return String.format("%.2f", d); } }
java
{ "resource": "" }
q178608
ConfigBuildRef.putShiftAttrs
test
public final void putShiftAttrs(final String fullName, final ConfigRangeAttrs attrs, final RowsMapping unitRowsMapping) { attrs.setUnitRowsMapping(unitRowsMapping); this.shiftMap.put(fullName, attrs); }
java
{ "resource": "" }
q178609
TieWebSheetBean.setWb
test
public void setWb(final Workbook pWb) { this.getSerialWb().setWb(pWb); this.wbWrapper = XSSFEvaluationWorkbook.create((XSSFWorkbook) pWb); }
java
{ "resource": "" }
q178610
TieWebSheetBean.getWbWrapper
test
public XSSFEvaluationWorkbook getWbWrapper() { if ((this.wbWrapper == null) && (this.getWb() != null)) { this.wbWrapper = XSSFEvaluationWorkbook .create((XSSFWorkbook) this.getWb()); } return wbWrapper; }
java
{ "resource": "" }
q178611
TieWebSheetBean.getFormulaEvaluator
test
public FormulaEvaluator getFormulaEvaluator() { if ((this.formulaEvaluator == null) && (this.getWb() != null)) { this.formulaEvaluator = this.getWb().getCreationHelper() .createFormulaEvaluator(); } return formulaEvaluator; }
java
{ "resource": "" }
q178612
TieWebSheetBean.reCalcMaxColCounts
test
public void reCalcMaxColCounts() { if ((this.getSheetConfigMap() == null) || (this.getSheetConfigMap().isEmpty())) { this.maxColCounts = 0; return; } int maxColumns = 0; for (SheetConfiguration sheetConfig : this.getSheetConfigMap() .values()) { int counts = sheetConfig.getHeaderCellRa...
java
{ "resource": "" }
q178613
TieWebSheetBean.loadWebSheet
test
public int loadWebSheet(final InputStream inputStream, final Map<String, Object> pDataContext) { return this.getHelper().getWebSheetLoader() .loadWorkbook(inputStream, pDataContext); }
java
{ "resource": "" }
q178614
TieWebSheetBean.loadWebSheet
test
public int loadWebSheet(final Workbook pWb, final Map<String, Object> pDataContext) { return this.getHelper().getWebSheetLoader().loadWorkbook(pWb, pDataContext); }
java
{ "resource": "" }
q178615
TieWebSheetBean.loadWorkSheetByTabName
test
public int loadWorkSheetByTabName(final String tabName) { try { int sheetId = this.getHelper().getWebSheetLoader() .findTabIndexWithName(tabName); if ((getSheetConfigMap() != null) && (sheetId < getSheetConfigMap().size())) { this.getHelper().getWebSheetLoader().loadWorkSheet(tabName); ...
java
{ "resource": "" }
q178616
TieWebSheetBean.doExport
test
public void doExport() { try { String fileName = this.getExportFileName(); ByteArrayOutputStream out = new ByteArrayOutputStream(); this.getWb().write(out); InputStream stream = new BufferedInputStream( new ByteArrayInputStream(out.toByteArray())); exportFile = new DefaultStreamedContent(...
java
{ "resource": "" }
q178617
TieWebSheetBean.doSave
test
public void doSave() { this.setSubmitMde(false); if (!this.getHelper().getValidationHandler().preValidation()) { LOG.fine("Validation failded before saving"); return; } processSave(); this.getHelper().getWebSheetLoader().setUnsavedStatus( RequestContext.getCurrentInstance(), false); ...
java
{ "resource": "" }
q178618
TieWebSheetBean.doSubmit
test
public void doSubmit() { this.setSubmitMde(true); // validation may behavior differently depend on the submit mode. // e.g. when submit mode = false, empty fields or value not changed cells // don't need to pass the validation rule. This allow partial save the form. // when submit mode = true, all...
java
{ "resource": "" }
q178619
TieWebSheetBean.populateComponent
test
public void populateComponent(final ComponentSystemEvent event) { UIComponent component = event.getComponent(); int[] rowcol = CellUtility .getRowColFromComponentAttributes(component); int row = rowcol[0]; int col = rowcol[1]; FacesCell fcell = CellUtility.getFacesCellFromBodyRow(row, col, this...
java
{ "resource": "" }
q178620
TieWebSheetBean.getCurrentSheetConfig
test
public SheetConfiguration getCurrentSheetConfig() { String currentTabName = this.getCurrent().getCurrentTabName(); if (currentTabName == null) { return null; } return this.getSheetConfigMap().get(currentTabName); }
java
{ "resource": "" }
q178621
TieWebSheetBean.readObject
test
private void readObject(final java.io.ObjectInputStream in) throws IOException { try { in.defaultReadObject(); recover(); } catch (EncryptedDocumentException | ClassNotFoundException e) { LOG.log(Level.SEVERE, " error in readObject of serialWorkbook : " + e.getLocalizedMessage(), ...
java
{ "resource": "" }
q178622
DateTimeCustomConverter.getLocale
test
private Locale getLocale(final FacesContext context, final UIComponent component) { String localeStr = (String) component.getAttributes() .get(TieConstants.COMPONENT_ATTR_LOCALE); if (localeStr == null) { return context.getViewRoot().getLocale(); } return Locale.forLanguageTag(localeStr);...
java
{ "resource": "" }
q178623
TieWebSheetPicturesService.getPicture
test
public StreamedContent getPicture() { FacesContext context = FacesContext.getCurrentInstance(); if (context.getCurrentPhaseId() == PhaseId.RENDER_RESPONSE) { // So, we're rendering the HTML. Return a stub StreamedContent so // that it will generate right URL. LOG.fine(" return empty picture"); r...
java
{ "resource": "" }
q178624
TieWebSheetBeanHelper.getCellHelper
test
public final CellHelper getCellHelper() { if ((this.cellHelper == null) && (this.parent != null)) { this.cellHelper = new CellHelper(parent); } return cellHelper; }
java
{ "resource": "" }
q178625
TieWebSheetBeanHelper.getPicHelper
test
public final PicturesHelper getPicHelper() { if ((this.picHelper == null) && (this.parent != null)) { this.picHelper = new PicturesHelper(parent); } return picHelper; }
java
{ "resource": "" }
q178626
TieWebSheetBeanHelper.getValidationHandler
test
public final ValidationHandler getValidationHandler() { if ((this.validationHandler == null) && (this.parent != null)) { this.validationHandler = new ValidationHandler(parent); } return validationHandler; }
java
{ "resource": "" }
q178627
TieWebSheetBeanHelper.getChartHelper
test
public final ChartHelper getChartHelper() { if ((this.chartHelper == null) && (this.parent != null)) { this.chartHelper = new ChartHelper(parent); } return chartHelper; }
java
{ "resource": "" }
q178628
ShiftFormulaUtility.convertSharedFormulas
test
public static Ptg[] convertSharedFormulas(final Ptg[] ptgs, final ShiftFormulaRef shiftFormulaRef) { List<Ptg> newPtgList = new ArrayList<>(); Object ptg; for (int k = 0; k < ptgs.length; ++k) { ptg = ptgs[k]; newPtgList.addAll(Arrays .asList(convertPtg(ptgs, k, shiftFormulaRef, ptg))); ...
java
{ "resource": "" }
q178629
ShiftFormulaUtility.convertPtg
test
private static Ptg[] convertPtg(final Ptg[] ptgs, final int position, final ShiftFormulaRef shiftFormulaRef, final Object ptg) { byte originalOperandClass = -1; if (!((Ptg) ptg).isBaseToken()) { originalOperandClass = ((Ptg) ptg).getPtgClass(); } int currentRow; currentRow = getFirstSupport...
java
{ "resource": "" }
q178630
ShiftFormulaUtility.convertPtgForWatchList
test
private static Ptg[] convertPtgForWatchList(final Ptg[] ptgs, final int position, final ShiftFormulaRef shiftFormulaRef, final Object ptg, final byte originalOperandClass, final int currentRow) { List<SerialRow> rowlist = getRowsList(currentRow, shiftFormulaRef.getCurrentRowsMappingList()); if ((...
java
{ "resource": "" }
q178631
ShiftFormulaUtility.singlePtg
test
private static Ptg[] singlePtg(final Object ptg, final byte originalOperandClass, final int formulaChanged) { Ptg[] newPtg = new Ptg[1]; if (originalOperandClass != (-1)) { ((Ptg) ptg).setClass(originalOperandClass); } Object ptgAfter = ptg; if (ptg instanceof FuncVarPtg) { FuncVarPtg fptg = ...
java
{ "resource": "" }
q178632
ShiftFormulaUtility.getRowsList
test
private static List<SerialRow> getRowsList(final int currentRow, final List<RowsMapping> currentRowsMappingList) { List<SerialRow> all = null; int size = currentRowsMappingList.size(); for (RowsMapping rowsmapping : currentRowsMappingList) { List<SerialRow> current = rowsmapping.get(currentRow); if...
java
{ "resource": "" }
q178633
ShiftFormulaUtility.assembleRowsListFromRowsMapping
test
private static List<SerialRow> assembleRowsListFromRowsMapping( final List<SerialRow> all, final List<SerialRow> current) { List<SerialRow> list; if (all == null) { list = new ArrayList<>(); list.addAll(current); } else { list = all; for (SerialRow row : current) { if (!all.contains(ro...
java
{ "resource": "" }
q178634
ShiftFormulaUtility.fixupRefRelativeRowOneToOne
test
protected static Object fixupRefRelativeRowOneToOne(final Object ptg, final Row newRow) { if (ptg instanceof RefPtgBase) { if (ptg instanceof Ref3DPxg) { Ref3DPxg ref3dPxg = (Ref3DPxg) ptg; Ref3DPxg new3dpxg = new Ref3DPxg( ref3dPxg.getExternalWorkbookNumber(), new SheetIdentifier(nul...
java
{ "resource": "" }
q178635
ShiftFormulaUtility.buildDynamicRowForRefPtgBase
test
private static void buildDynamicRowForRefPtgBase(final Object ptg, final byte originalOperandClass, final List<SerialRow> rowList, final Ptg[] newPtg, final boolean includeParenthesis) { RefPtgBase refPtg = (RefPtgBase) ptg; int unitSize = 1; if (includeParenthesis) { unitSize = 2; } for (int...
java
{ "resource": "" }
q178636
ShiftFormulaUtility.buildDynamicRowForAreaPtgBase
test
private static void buildDynamicRowForAreaPtgBase(final Object ptg, final byte originalOperandClass, final List<SerialRow> rowList, final Ptg[] newPtg) { AreaPtgBase areaPtg = (AreaPtgBase) ptg; int originFirstRow = areaPtg.getFirstRow(); int originLastRow = areaPtg.getLastRow(); int unitSize = 2; ...
java
{ "resource": "" }
q178637
ColorUtility.getBgColor
test
public static XColor getBgColor(final CTPlotArea ctPlot, final ThemesTable themeTable) { CTSolidColorFillProperties colorFill = null; try { colorFill = ctPlot.getSpPr().getSolidFill(); } catch (Exception ex) { LOG.log(Level.FINE, "No entry in bgcolor for solidFill", ex); } XColor xcolor = f...
java
{ "resource": "" }
q178638
ColorUtility.geColorFromSpPr
test
public static XColor geColorFromSpPr(final int index, final CTShapeProperties ctSpPr, final ThemesTable themeTable, final boolean isLineColor) { CTSolidColorFillProperties colorFill = null; try { if (isLineColor) { colorFill = ctSpPr.getLn().getSolidFill(); } else { colorFill = ctSpP...
java
{ "resource": "" }
q178639
ColorUtility.findAutomaticFillColor
test
private static XColor findAutomaticFillColor(final ThemesTable themeTable, final CTSolidColorFillProperties colorFill) { // if there's no solidFill, then use automaticFill color if (colorFill == null) { return null; } CTSchemeColor ctsColor = colorFill.getSchemeClr(); if (ctsColor != null) { ...
java
{ "resource": "" }
q178640
ColorUtility.getXColorFromSchemeClr
test
private static XColor getXColorFromSchemeClr( final CTSchemeColor ctsColor, final ThemesTable themeTable) { if (ctsColor.getVal() != null) { return getXColorWithSchema(ctsColor.getVal().toString(), 0, ctsColor, themeTable); } return null; }
java
{ "resource": "" }
q178641
ColorUtility.getXColorFromRgbClr
test
private static XColor getXColorFromRgbClr(final CTSRgbColor ctrColor) { XSSFColor bcolor = null; try { byte[] rgb = ctrColor.getVal(); bcolor = new XSSFColor(rgb); } catch (Exception ex) { LOG.log(Level.SEVERE, "Cannot get rgb color error = " + ex.getLocalizedMessage(), ex); return null; ...
java
{ "resource": "" }
q178642
ColorUtility.getXColorWithAutomaticFill
test
private static XColor getXColorWithAutomaticFill(final int index, final ThemesTable themeTable) { int reminder = (index + 1) % AUTOCOLORSIZE; if (reminder == 0) { reminder = AUTOCOLORSIZE; } String schema = AUTOCOLORNAME + reminder; double tint = getAutomaticTint(index); return getXColorWith...
java
{ "resource": "" }
q178643
ColorUtility.xssfClrToClr
test
public static Color xssfClrToClr(final XSSFColor xssfColor) { short[] rgb = getTripletFromXSSFColor(xssfColor); return new Color(rgb[0], rgb[1], rgb[2]); }
java
{ "resource": "" }
q178644
ColorUtility.getTripletFromXSSFColor
test
public static short[] getTripletFromXSSFColor( final XSSFColor xssfColor) { short[] rgbfix = { RGB8BITS, RGB8BITS, RGB8BITS }; if (xssfColor != null) { byte[] rgb = xssfColor.getRGBWithTint(); if (rgb == null) { rgb = xssfColor.getRGB(); } // Bytes are signed, so values of 128+ are nega...
java
{ "resource": "" }
q178645
ColorUtility.getBgColorFromCell
test
static String getBgColorFromCell(final Workbook wb, final Cell poiCell, final CellStyle cellStyle) { String style = ""; if (poiCell instanceof HSSFCell) { int bkColorIndex = cellStyle.getFillForegroundColor(); HSSFColor color = HSSFColor.getIndexHash().get(bkColorIndex); if (color != null) { ...
java
{ "resource": "" }
q178646
CellControlsUtility.findComponentNameFromClass
test
private static String findComponentNameFromClass( final UIComponent component) { String cname = component.getClass().getSimpleName(); if (supportComponents.contains(cname)) { return cname; } return null; }
java
{ "resource": "" }
q178647
CellControlsUtility.populateAttributes
test
public static void populateAttributes(final UIComponent component, final FacesCell fcell, final Map<String, Map<String, String>> defaultControlMap) { List<CellFormAttributes> inputAttrs = fcell.getInputAttrs(); String cname = findComponentNameFromClass(component); if (cname == null) { return; ...
java
{ "resource": "" }
q178648
CellControlsUtility.matchParaMeterOfMethod
test
private static AttributesType matchParaMeterOfMethod(final Object obj, final String methodName) { for (AttributesType attr : AttributesType.values()) { try { obj.getClass().getMethod(methodName, new Class[] { attr.clazz }); return attr; } catch (Exception ex) { LOG.log(Level.FIN...
java
{ "resource": "" }
q178649
CellControlsUtility.setObjectProperty
test
public static void setObjectProperty(final Object obj, final String propertyName, final String propertyValue, final boolean ignoreNonExisting) { try { String methodName = "set" + Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1); AttributesType parameterType = ma...
java
{ "resource": "" }
q178650
CellControlsUtility.getObjectPropertyValue
test
public static String getObjectPropertyValue(final Object obj, final String propertyName, final boolean ignoreNonExisting) { try { Method method = obj.getClass() .getMethod("get" + Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1)); return (String) method.invo...
java
{ "resource": "" }
q178651
CellControlsUtility.setupControlAttributes
test
public static void setupControlAttributes(final int originRowIndex, final FacesCell fcell, final Cell poiCell, final SheetConfiguration sheetConfig, final CellAttributesMap cellAttributesMap) { int rowIndex = originRowIndex; if (rowIndex < 0) { rowIndex = poiCell.getRowIndex(); } String sk...
java
{ "resource": "" }
q178652
CellControlsUtility.findCellValidateAttributes
test
public static List<CellFormAttributes> findCellValidateAttributes( final Map<String, List<CellFormAttributes>> validateMaps, final int originRowIndex, final Cell cell) { String key = cell.getSheet().getSheetName() + "!" + CellUtility .getCellIndexNumberKey(cell.getColumnIndex(), originRowIndex); ...
java
{ "resource": "" }
q178653
PicturesHelper.setupFacesCellPictureCharts
test
public final void setupFacesCellPictureCharts(final Sheet sheet1, final FacesCell fcell, final Cell cell, final String fId) { if (parent.getPicturesMap() != null) { setupFacesCellPicture(sheet1, fcell, cell, fId); } if (parent.getCharsData().getChartsMap() != null) { setupFacesCellCharts(sheet1, fc...
java
{ "resource": "" }
q178654
PicturesHelper.setupFacesCellCharts
test
private void setupFacesCellCharts(final Sheet sheet1, final FacesCell fcell, final Cell cell, final String fId) { try { String chartId = parent.getCharsData().getChartPositionMap() .get(fId); if (chartId != null) { BufferedImage img = parent.getCharsData().getChartsMap() .get(chartId); ...
java
{ "resource": "" }
q178655
PicturesHelper.setupFacesCellPicture
test
private void setupFacesCellPicture(final Sheet sheet1, final FacesCell fcell, final Cell cell, final String fId) { try { Picture pic = parent.getPicturesMap().get(fId); if (pic != null) { fcell.setContainPic(true); fcell.setPictureId(fId); fcell.setPictureStyle(PicturesUtility .gene...
java
{ "resource": "" }
q178656
ChartHelper.initChartsMap
test
private void initChartsMap(final Workbook wb) { try { if (wb instanceof XSSFWorkbook) { initXSSFChartsMap((XSSFWorkbook) wb, parent.getCharsData()); } } catch (Exception e) { LOG.log(Level.SEVERE, "getChartsMap Error Exception = " + e.getLocalizedMessage(), e); } }
java
{ "resource": "" }
q178657
ChartHelper.getPieTitle
test
private String getPieTitle(final ChartData chartData) { for (ChartSeries chartSeries : chartData.getSeriesList()) { if (chartSeries != null) { return getParsedCellValue(chartSeries.getSeriesLabel()); } } return ""; }
java
{ "resource": "" }
q178658
ChartHelper.setSeriesStyle
test
public final void setSeriesStyle(final JFreeChart chart, final int seriesIndex, final String style) { if (chart != null && style != null) { BasicStroke stroke = ChartUtility.toStroke(style); Plot plot = chart.getPlot(); if (plot instanceof CategoryPlot) { CategoryPlot categoryPlot = chart.getC...
java
{ "resource": "" }
q178659
ChartHelper.createPie3DChart
test
public JFreeChart createPie3DChart(final ChartData chartData) { // create the chart... final JFreeChart chart = ChartFactory.createPieChart3D( getPieTitle(chartData), // chart title createPieDataset(chartData), // data true, // include legend false, // tooltips false // urls ); ...
java
{ "resource": "" }
q178660
ChartHelper.setupBarStyle
test
private void setupBarStyle(final JFreeChart chart, final ChartData chartData) { setupStyle(chart, chartData); CategoryPlot plot = (CategoryPlot) chart.getPlot(); BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setBarPainter(new StandardBarPainter()); renderer.setItemMargin(TieConsta...
java
{ "resource": "" }
q178661
ChartHelper.initXSSFChartsMap
test
private void initXSSFChartsMap(final XSSFWorkbook wb, final ChartsData chartsData) { initAnchorsMap(wb, chartsData); Map<String, ClientAnchor> anchorMap = chartsData .getChartAnchorsMap(); Map<String, BufferedImage> chartMap = chartsData.getChartsMap(); Map<String, ChartData> chartDataMap = cha...
java
{ "resource": "" }
q178662
ChartHelper.getChartIdFromParent
test
private String getChartIdFromParent(final XSSFChart chart, final String sheetName) { if (chart.getParent() != null) { for (RelationPart rp : chart.getParent().getRelationParts()) { if (rp.getDocumentPart() == chart) { return sheetName + "!" + rp.getRelationship().getId(); } } } retu...
java
{ "resource": "" }
q178663
ChartHelper.initAnchorsMap
test
private void initAnchorsMap(final Workbook wb, final ChartsData chartsData) { try { if (wb instanceof XSSFWorkbook) { ChartUtility.initXSSFAnchorsMap((XSSFWorkbook) wb, chartsData); } } catch (Exception e) { LOG.log(Level.SEVERE, "Web Form getAnchorsMap Error Exception = " ...
java
{ "resource": "" }
q178664
ChartHelper.generateSingleXSSFChart
test
private void generateSingleXSSFChart(final XSSFChart chart, final String chartId, final XSSFSheet sheet, final Map<String, ClientAnchor> anchorMap, final Map<String, BufferedImage> chartMap, final Map<String, ChartData> chartDataMap) { ClientAnchor anchor; try { anchor = anchorMap.get(chartId)...
java
{ "resource": "" }
q178665
ConfigurationUtility.transformToCollectionObject
test
@SuppressWarnings("rawtypes") public static Collection transformToCollectionObject( final ExpressionEngine engine, final String collectionName, final Map<String, Object> context) { Object collectionObject = engine.evaluate(collectionName, context); if (!(collectionObject instanceof Collection)) { th...
java
{ "resource": "" }
q178666
ConfigurationUtility.getFullNameFromRow
test
public static String getFullNameFromRow(final Row row) { if (row != null) { Cell cell = row.getCell(TieConstants.HIDDEN_FULL_NAME_COLUMN); if (cell != null) { return cell.getStringCellValue(); } } return null; }
java
{ "resource": "" }
q178667
ConfigurationUtility.reBuildUpperLevelFormula
test
public static void reBuildUpperLevelFormula( final ConfigBuildRef configBuildRef, final String actionFullName) { Map<Cell, String> cachedMap = configBuildRef.getCachedCells(); Map<String, List<RowsMapping>> rowsMap = new HashMap<>(); for (Map.Entry<Cell, String> entry : cachedMap.entrySet()) { Cell...
java
{ "resource": "" }
q178668
ConfigurationUtility.setupUpperLevelFormula
test
private static void setupUpperLevelFormula(final Cell cell, final String originFormula, final String actionFullName, final Map<String, List<RowsMapping>> rowsMap, final ConfigBuildRef configBuildRef) { String fullName = getFullNameFromRow(cell.getRow()); // check wither it's upper level if (actionF...
java
{ "resource": "" }
q178669
ConfigurationUtility.buildCellFormulaForShiftedRows
test
public static void buildCellFormulaForShiftedRows(final Sheet sheet, final XSSFEvaluationWorkbook wbWrapper, final ShiftFormulaRef shiftFormulaRef, final Cell cell, final String originFormula) { // only shift when there's watchlist exist. if ((shiftFormulaRef.getWatchList() != null) && (!shiftFor...
java
{ "resource": "" }
q178670
ConfigurationUtility.gatherRowsMappingByFullName
test
public static List<RowsMapping> gatherRowsMappingByFullName( final ConfigBuildRef configBuildRef, final String fullName) { List<RowsMapping> list = new ArrayList<>(); Map<String, ConfigRangeAttrs> shiftMap = configBuildRef .getShiftMap(); for (Map.Entry<String, ConfigRangeAttrs> entry : shiftMap ...
java
{ "resource": "" }
q178671
ConfigurationUtility.changeIndexNumberInShiftMap
test
public static void changeIndexNumberInShiftMap( final Map<String, ConfigRangeAttrs> shiftMap, final Map<String, String> changeMap) { for (Map.Entry<String, String> entry : changeMap.entrySet()) { String key = entry.getKey(); String newKey = entry.getValue(); ConfigRangeAttrs attrs = shiftMap.get(...
java
{ "resource": "" }
q178672
ConfigurationUtility.changeUpperLevelFinalLength
test
public static void changeUpperLevelFinalLength( final Map<String, ConfigRangeAttrs> shiftMap, final String addedFullName, final int increasedLength) { String[] parts = addedFullName.split(":"); StringBuilder fname = new StringBuilder(); for (int i = 0; i < (parts.length - 1); i++) { if (i == 0) { ...
java
{ "resource": "" }
q178673
ConfigurationUtility.changeIndexNumberInHiddenColumn
test
public static void changeIndexNumberInHiddenColumn( final ConfigBuildRef configBuildRef, final int startRowIndex, final String fullName, final Map<String, String> changeMap, final int steps) { String searchName = fullName.substring(0, fullName.lastIndexOf('.') + 1); Sheet sheet = configBuildRef.g...
java
{ "resource": "" }
q178674
ConfigurationUtility.setFullNameInHiddenColumn
test
public static void setFullNameInHiddenColumn(final Row row, final String fullName) { Cell cell = row.getCell(TieConstants.HIDDEN_FULL_NAME_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(fullName); }
java
{ "resource": "" }
q178675
ConfigurationUtility.getOriginalRowNumInHiddenColumn
test
public static int getOriginalRowNumInHiddenColumn(final Row row) { if (row != null) { Cell cell = row.getCell( TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); String rowNum = cell.getStringCellValue(); try { if ((rowNum != null) && (!rowNum.isEmpty(...
java
{ "resource": "" }
q178676
ConfigurationUtility.setOriginalRowNumInHiddenColumn
test
public static void setOriginalRowNumInHiddenColumn(final Row row, final int rowNum) { Cell cell = row.getCell( TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN, MissingCellPolicy.CREATE_NULL_AS_BLANK); cell.setCellValue(Integer.toString(rowNum)); cell.setCellType(CellType.STRING); }
java
{ "resource": "" }
q178677
ConfigurationUtility.findParentRowsMappingFromShiftMap
test
public static List<RowsMapping> findParentRowsMappingFromShiftMap( final String[] parts, final Map<String, ConfigRangeAttrs> shiftMap) { StringBuilder fullName = new StringBuilder(); List<RowsMapping> rowsMappingList = new ArrayList<>(); /** * skip first one and last one. first one is line no. la...
java
{ "resource": "" }
q178678
ConfigurationUtility.findChildRowsMappingFromShiftMap
test
public static List<RowsMapping> findChildRowsMappingFromShiftMap( final String fullName, final NavigableMap<String, ConfigRangeAttrs> shiftMap) { List<RowsMapping> rowsMappingList = new ArrayList<>(); NavigableMap<String, ConfigRangeAttrs> tailmap = shiftMap .tailMap(fullName, false); for (Map.E...
java
{ "resource": "" }
q178679
ConfigurationUtility.findItemInCollection
test
@SuppressWarnings("rawtypes") public static Object findItemInCollection(final Collection collection, final int index) { if (index >= 0) { if (collection instanceof List) { List list = (List) collection; return list.get(index); } int i = 0; for (Object object : collection) { if (i...
java
{ "resource": "" }
q178680
ConfigurationUtility.buildCurrentRange
test
public static ConfigRange buildCurrentRange( final ConfigRange sourceConfigRange, final Sheet sheet, final int insertPosition) { ConfigRange current = new ConfigRange(sourceConfigRange); int shiftNum = insertPosition - sourceConfigRange.getFirstRowAddr().getRow(); current.shiftRowRef(sheet, shiftN...
java
{ "resource": "" }
q178681
ConfigurationUtility.isStaticRow
test
public static boolean isStaticRow(final ConfigRange sourceConfigRange, final int rowIndex) { if (sourceConfigRange.getCommandList() != null) { for (int i = 0; i < sourceConfigRange.getCommandList() .size(); i++) { Command command = sourceConfigRange.getCommandList().get(i); if ((rowIndex >= c...
java
{ "resource": "" }
q178682
ConfigurationUtility.isStaticRowRef
test
public static boolean isStaticRowRef( final ConfigRange sourceConfigRange, final Row row) { if (sourceConfigRange.getCommandList() != null) { for (int i = 0; i < sourceConfigRange.getCommandList() .size(); i++) { Command command = sourceConfigRange.getCommandList().get(i); int rowIndex = row....
java
{ "resource": "" }
q178683
ConfigurationUtility.replaceExpressionWithCellValue
test
public static String replaceExpressionWithCellValue( final String attrValue, final int rowIndex, final Sheet sheet) { int ibegin = 0; int ifind; int inameEnd; String tempStr; String findStr; String replaceStr; String returnStr = attrValue; while ((ifind = attrValue.indexOf(TieConstants.CEL...
java
{ "resource": "" }
q178684
ConfigurationUtility.indexMergedRegion
test
public static Map<String, CellRangeAddress> indexMergedRegion( final Sheet sheet1) { int numRegions = sheet1.getNumMergedRegions(); Map<String, CellRangeAddress> cellRangeMap = new HashMap<>(); for (int i = 0; i < numRegions; i++) { CellRangeAddress caddress = sheet1.getMergedRegion(i); if (cad...
java
{ "resource": "" }
q178685
ConfigurationUtility.skippedRegionCells
test
public static List<String> skippedRegionCells(final Sheet sheet1) { int numRegions = sheet1.getNumMergedRegions(); List<String> skipCellList = new ArrayList<>(); for (int i = 0; i < numRegions; i++) { CellRangeAddress caddress = sheet1.getMergedRegion(i); if (caddress != null) { addSkipCellToLis...
java
{ "resource": "" }
q178686
ConfigurationUtility.addSkipCellToListInTheRegion
test
private static void addSkipCellToListInTheRegion( final List<String> skipCellList, final CellRangeAddress caddress) { for (int col = caddress.getFirstColumn(); col <= caddress .getLastColumn(); col++) { for (int row = caddress.getFirstRow(); row <= caddress .getLastRow(); row++) { if ((co...
java
{ "resource": "" }
q178687
ConfigurationUtility.buildSheetCommentFromAlias
test
public static void buildSheetCommentFromAlias(Sheet sheet, List<TieCommandAlias> tieCommandAliasList) { if ((tieCommandAliasList == null)||(tieCommandAliasList.isEmpty())) { return; } for (Row row : sheet) { for (Cell cell : row) { buildCellCommentFromalias(tieCommandA...
java
{ "resource": "" }
q178688
ConfigurationUtility.buildCellCommentFromalias
test
private static void buildCellCommentFromalias(List<TieCommandAlias> tieCommandAliasList, Cell cell) { String value = CellUtility.getCellValueWithoutFormat(cell); if ((value!=null)&&(!value.isEmpty())) { for (TieCommandAlias alias : tieCommandAliasList) { Matcher matcher = alias.getPattern().matcher(value...
java
{ "resource": "" }
q178689
ConfigurationHandler.buildConfiguration
test
public final Map<String, SheetConfiguration> buildConfiguration() { Map<String, SheetConfiguration> sheetConfigMap = new LinkedHashMap<>(); // in buildsheet, it's possible to add sheets in workbook. // so cache the sheetname first here. List<String> sheetNames = new ArrayList<>(); String sname; for ...
java
{ "resource": "" }
q178690
ConfigurationHandler.getSheetConfiguration
test
private SheetConfiguration getSheetConfiguration(final Sheet sheet, final String formName, final int sheetRightCol) { SheetConfiguration sheetConfig = new SheetConfiguration(); sheetConfig.setFormName(formName); sheetConfig.setSheetName(sheet.getSheetName()); int leftCol = sheet.getLeftCol(); int l...
java
{ "resource": "" }
q178691
ConfigurationHandler.buildFormCommandFromSheetConfig
test
private FormCommand buildFormCommandFromSheetConfig(final SheetConfiguration sheetConfig, final Sheet sheet) { int firstRow = sheetConfig.getBodyCellRange().getTopRow(); int leftCol = sheetConfig.getBodyCellRange().getLeftCol(); int rightCol = sheetConfig.getBodyCellRange().getRightCol(); int lastRow = sh...
java
{ "resource": "" }
q178692
ConfigurationHandler.verifyLastCell
test
private int verifyLastCell(final Row row, final int stoppoint, final int sheetRightCol) { int lastCol = sheetRightCol; int col; for (col = lastCol; col >= stoppoint; col--) { Cell cell = row.getCell(col); if ((cell != null) && (cell.getCellTypeEnum() != CellType.BLANK)) { break; } } ...
java
{ "resource": "" }
q178693
ConfigurationHandler.buildSheet
test
public final void buildSheet(final Sheet sheet, final Map<String, SheetConfiguration> sheetConfigMap, final CellAttributesMap cellAttributesMap) { if ((sheet.getLastRowNum() <= 0) && (sheet.getRow(0) == null)) { // this is a empty sheet. skip it. return; } checkAndRepairLastRow(sheet); int s...
java
{ "resource": "" }
q178694
ConfigurationHandler.checkAndRepairLastRow
test
private final void checkAndRepairLastRow(final Sheet sheet) { // repair last row if it's inserted in the configuration generation Row lastrow = sheet.getRow(sheet.getLastRowNum()); // if it's lastrow and all the cells are blank. then remove the lastrow. if (lastrow != null) { for (Cell cell : lastrow) {...
java
{ "resource": "" }
q178695
ConfigurationHandler.buildCommandListFromSheetComment
test
private List<ConfigCommand> buildCommandListFromSheetComment(final XSSFSheet sheet, final int sheetRightCol, final CellAttributesMap cellAttributesMap) { List<ConfigCommand> commandList = new ArrayList<>(); // if skip then return empty list. if (parent.isSkipConfiguration()) { return commandList; } ...
java
{ "resource": "" }
q178696
ConfigurationHandler.setParentForChildCommand
test
private void setParentForChildCommand(final List<ConfigCommand> commandList, final int i, final ConfigCommand child) { int matchIndex = -1; ConfigRange matchRange = null; for (int j = 0; j < commandList.size(); j++) { if (j != i) { Command commandParent = commandList.get(j); if (!commandParen...
java
{ "resource": "" }
q178697
ConfigurationHandler.hasEachCommandInTheList
test
private boolean hasEachCommandInTheList(final List<ConfigCommand> commandList) { if (commandList != null) { for (ConfigCommand command : commandList) { if (command.getCommandTypeName().equalsIgnoreCase(TieConstants.COMMAND_EACH)) { return true; } } } return false; }
java
{ "resource": "" }
q178698
ConfigurationHandler.matchCommandToSheetConfigForm
test
private void matchCommandToSheetConfigForm(final Map<String, SheetConfiguration> sheetConfigMap, final List<String> formList, final ConfigCommand command) { for (String formname : formList) { SheetConfiguration sheetConfig = sheetConfigMap.get(formname); if (WebSheetUtility.insideRange(command.getConfigR...
java
{ "resource": "" }
q178699
ConfigurationHandler.copyTemplateForTieCommands
test
private void copyTemplateForTieCommands(final Sheet sheet) { // if skip configuration. then return. if (parent.isSkipConfiguration()) { return; } Workbook wb = sheet.getWorkbook(); String copyName = TieConstants.COPY_SHEET_PREFIX + sheet.getSheetName(); if (wb.getSheet(copyName) == null) { She...
java
{ "resource": "" }