_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q178800
PicturesUtility.generatePictureStyle
test
public static String generatePictureStyle(final Sheet sheet1, final FacesCell fcell, final Cell cell, final Picture pic) { ClientAnchor anchor = pic.getClientAnchor(); if (anchor != null) { AnchorSize anchorSize = getAnchorSize(sheet1, fcell, cell, anchor); if (anchorSize != null) { retur...
java
{ "resource": "" }
q178801
PicturesUtility.generateChartStyle
test
public static String generateChartStyle(final Sheet sheet1, final FacesCell fcell, final Cell cell, final String chartId, final Map<String, ClientAnchor> anchorsMap) { ClientAnchor anchor = anchorsMap.get(chartId); if (anchor != null) { AnchorSize anchorSize = getAnchorSize(sheet1, fcell, cell, ...
java
{ "resource": "" }
q178802
PicturesUtility.getAnchorSize
test
public static AnchorSize getAnchorSize(final Sheet sheet1, final FacesCell fcell, final Cell cell, final ClientAnchor anchor) { if (!(sheet1 instanceof XSSFSheet)) { return null; } double picWidth = 0.0; double picHeight = 0.0; int left = anchor.getDx1() / org.apache.poi.util.Units.EMU...
java
{ "resource": "" }
q178803
TieCommandAlias.getPattern
test
public Pattern getPattern() { if ((this.pattern == null) && (alias != null)) { this.pattern = Pattern.compile("\\s*" + ParserUtility.wildcardToRegex(alias)); } return pattern; }
java
{ "resource": "" }
q178804
TieWebSheetChartsService.getChart
test
public StreamedContent getChart() throws IOException { 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...
java
{ "resource": "" }
q178805
SerialCell.recover
test
public final void recover(final Sheet sheet) { if (this.cellAddr != null) { this.setCell(sheet.getRow(this.cellAddr.getRow()) .getCell(this.cellAddr.getColumn())); } }
java
{ "resource": "" }
q178806
CellStyleUtility.getRowStyle
test
public static String getRowStyle(final Workbook wb, final Cell poiCell, final String inputType, final float rowHeight, final int rowspan) { CellStyle cellStyle = poiCell.getCellStyle(); if ((cellStyle != null) && (rowspan == 1)) { short fontIdx = cellStyle.getFontIndex(); Font font = wb.getFontA...
java
{ "resource": "" }
q178807
CellStyleUtility.getCellFontStyle
test
public static String getCellFontStyle(final Workbook wb, final Cell poiCell) { CellStyle cellStyle = poiCell.getCellStyle(); StringBuilder webStyle = new StringBuilder(); if (cellStyle != null) { short fontIdx = cellStyle.getFontIndex(); Font font = wb.getFontAt(fontIdx); if (font.getItalic()...
java
{ "resource": "" }
q178808
CellStyleUtility.getCellFontColor
test
private static String getCellFontColor(final Font font) { short[] rgbfix = { TieConstants.RGB_MAX, TieConstants.RGB_MAX, TieConstants.RGB_MAX }; if (font instanceof XSSFFont) { XSSFColor color = ((XSSFFont) font).getXSSFColor(); if (color != null) { rgbfix = ColorUtility.getTripletFromXSSFColor(...
java
{ "resource": "" }
q178809
CellStyleUtility.getCellFontDecoration
test
private static String getCellFontDecoration(final Font font) { StringBuilder decoration = new StringBuilder(); if (font.getUnderline() != 0) { decoration.append(" underline"); } if (font.getStrikeout()) { decoration.append(" line-through"); } return decoration.toString(); }
java
{ "resource": "" }
q178810
CellStyleUtility.getCellStyle
test
public static String getCellStyle(final Workbook wb, final Cell poiCell, final String inputType) { CellStyle cellStyle = poiCell.getCellStyle(); StringBuilder webStyle = new StringBuilder(); if (cellStyle != null) { if (!inputType.isEmpty()) { webStyle.append(getAlignmentFromCell(poiCell, cellSt...
java
{ "resource": "" }
q178811
CellStyleUtility.getColumnStyle
test
public static String getColumnStyle(final Workbook wb, final FacesCell fcell, final Cell poiCell, final float rowHeight) { String inputType = fcell.getInputType(); CellStyle cellStyle = poiCell.getCellStyle(); StringBuilder webStyle = new StringBuilder(); if (cellStyle != null) { if (fcell.isC...
java
{ "resource": "" }
q178812
CellStyleUtility.getAlignmentFromCell
test
private static String getAlignmentFromCell(final Cell poiCell, final CellStyle cellStyle) { String style = ""; switch (cellStyle.getAlignmentEnum()) { case LEFT: style = TieConstants.TEXT_ALIGN_LEFT; break; case RIGHT: style = TieConstants.TEXT_ALIGN_RIGHT; break; case CENTER: s...
java
{ "resource": "" }
q178813
CellStyleUtility.getVerticalAlignmentFromCell
test
private static String getVerticalAlignmentFromCell( final CellStyle cellStyle) { String style = ""; switch (cellStyle.getVerticalAlignmentEnum()) { case TOP: style = TieConstants.VERTICAL_ALIGN_TOP; break; case CENTER: style = TieConstants.VERTICAL_ALIGN_CENTER; break; case BOTTOM: ...
java
{ "resource": "" }
q178814
CellStyleUtility.calcTotalHeight
test
public static int calcTotalHeight(final Sheet sheet1, final int firstRow, final int lastRow, final int additionalHeight) { int totalHeight = additionalHeight; for (int i = firstRow; i <= lastRow; i++) { totalHeight += sheet1.getRow(i).getHeight(); } return totalHeight; }
java
{ "resource": "" }
q178815
CellStyleUtility.setupCellStyle
test
public static void setupCellStyle(final Workbook wb, final FacesCell fcell, final Cell poiCell, final float rowHeight) { CellStyle cellStyle = poiCell.getCellStyle(); if ((cellStyle != null) && (!cellStyle.getLocked())) { // not locked if (fcell.getInputType().isEmpty()) { fcell.setInputTyp...
java
{ "resource": "" }
q178816
CellStyleUtility.getInputTypeFromCellType
test
@SuppressWarnings("deprecation") private static String getInputTypeFromCellType(final Cell cell) { String inputType = TieConstants.CELL_INPUT_TYPE_TEXT; if (cell.getCellTypeEnum() == CellType.NUMERIC) { inputType = TieConstants.CELL_INPUT_TYPE_DOUBLE; } CellStyle style = cell.getCellStyle(); if (...
java
{ "resource": "" }
q178817
FacesUtility.getResourcePaths
test
public static Set<String> getResourcePaths(final FacesContext context, final String path) { return context.getExternalContext().getResourcePaths(path); }
java
{ "resource": "" }
q178818
FacesUtility.getResourceAsStream
test
public static InputStream getResourceAsStream( final FacesContext context, final String path) { return context.getExternalContext().getResourceAsStream(path); }
java
{ "resource": "" }
q178819
FacesUtility.removePrefixPath
test
public static String removePrefixPath(final String prefix, final String resource) { String normalizedResource = resource; if (normalizedResource.startsWith(prefix)) { normalizedResource = normalizedResource .substring(prefix.length() - 1); } return normalizedResource; }
java
{ "resource": "" }
q178820
FacesUtility.evalInputType
test
public static boolean evalInputType(final String input, final String type) { Scanner scanner = new Scanner(input); boolean ireturn = false; if ("Integer".equalsIgnoreCase(type)) { ireturn = scanner.hasNextInt(); } else if ("Double".equalsIgnoreCase(type)) { ireturn = scanner.hasNextDouble(); ...
java
{ "resource": "" }
q178821
FacesUtility.findBean
test
@SuppressWarnings("unchecked") public static <T> T findBean(final String beanName) { FacesContext context = FacesContext.getCurrentInstance(); return (T) context.getApplication().evaluateExpressionGet(context, TieConstants.EL_START + beanName + TieConstants.EL_END, Object.class); }
java
{ "resource": "" }
q178822
FacesUtility.strJoin
test
public static String strJoin(final short[] aArr, final String sSep) { StringBuilder sbStr = new StringBuilder(); for (int i = 0, il = aArr.length; i < il; i++) { if (i > 0) { sbStr.append(sSep); } sbStr.append(aArr[i]); } return sbStr.toString(); }
java
{ "resource": "" }
q178823
FacesUtility.round
test
public static double round(final double value, final int places) { if (places < 0) { throw new IllegalArgumentException(); } BigDecimal bd = BigDecimal.valueOf(value); bd = bd.setScale(places, RoundingMode.HALF_UP); return bd.doubleValue(); }
java
{ "resource": "" }
q178824
TieWebSheetView.getTabType
test
public String getTabType() { int sheetId = webFormTabView.getActiveIndex(); if ((sheetId >= 0) && (tabs != null)) { if (sheetId >= tabs.size()) { sheetId = 0; } tabType = tabs.get(sheetId).type.toLowerCase(); } else { tabType = TieConstants.TAB_TYPE_NONE; } return tabType; }
java
{ "resource": "" }
q178825
TieWebSheetView.getTabStyle
test
public String getTabStyle() { String tabStyle = TieConstants.TAB_STYLE_VISIBLE; int sheetId = webFormTabView.getActiveIndex(); if ((sheetId >= 0) && (sheetId < tabs.size())) { tabStyle = TieConstants.TAB_STYLE_INVISIBLE; } return tabStyle; }
java
{ "resource": "" }
q178826
TieWebSheetView.getDefaultDatePattern
test
public String getDefaultDatePattern() { if (defaultDatePattern == null) { DateFormat formatter = DateFormat.getDateInstance(DateFormat.SHORT, Locale.getDefault()); defaultDatePattern = ((SimpleDateFormat) formatter).toLocalizedPattern(); } return defaultDatePattern; }
java
{ "resource": "" }
q178827
TieWebSheetView.getDecimalSeparatorByDefaultLocale
test
public String getDecimalSeparatorByDefaultLocale() { final DecimalFormat nf = (DecimalFormat) DecimalFormat.getInstance(getDefaultLocale()); return "" + nf.getDecimalFormatSymbols().getDecimalSeparator(); }
java
{ "resource": "" }
q178828
TieWebSheetView.getThousandSeparatorByDefaultLocale
test
public String getThousandSeparatorByDefaultLocale() { final DecimalFormat nf = (DecimalFormat) DecimalFormat.getInstance(getDefaultLocale()); return "" + nf.getDecimalFormatSymbols().getGroupingSeparator(); }
java
{ "resource": "" }
q178829
TieWebSheetView.setTieCommandAliasList
test
public void setTieCommandAliasList(String aliasListJson) { Gson gson = new Gson(); Type aliasListType = new TypeToken<ArrayList<TieCommandAlias>>(){}.getType(); this.tieCommandAliasList = gson.fromJson(aliasListJson, aliasListType); }
java
{ "resource": "" }
q178830
FormCommand.buildFormWatchList
test
private List<Integer> buildFormWatchList( final XSSFEvaluationWorkbook wbWrapper, final Sheet sheet) { List<Integer> watchList = new ArrayList<>(); ConfigRange cRange = this.getConfigRange(); List<ConfigCommand> commandList = cRange.getCommandList(); if (commandList.isEmpty()) { // if no command...
java
{ "resource": "" }
q178831
FormCommand.buildWatchListForCell
test
private void buildWatchListForCell( final XSSFEvaluationWorkbook wbWrapper, final int sheetIndex, final Cell cell, final List<Integer> watchList, final int lastStaticRow) { String formula = cell.getCellFormula(); Ptg[] ptgs = FormulaParser.parse(formula, wbWrapper, FormulaType.CELL, sheetIndex); ...
java
{ "resource": "" }
q178832
FormCommand.addToWatchList
test
private void addToWatchList(final int addRow, final int lastStaticRow, final List<Integer> watchList) { if ((addRow > lastStaticRow) && !(watchList.contains(addRow))) { watchList.add(addRow); } }
java
{ "resource": "" }
q178833
ParserUtility.isCommandString
test
public static boolean isCommandString(final String str) { if (str == null) { return false; } return str.startsWith(TieConstants.COMMAND_PREFIX); }
java
{ "resource": "" }
q178834
ParserUtility.parseWidgetAttributes
test
public static void parseWidgetAttributes(final Cell cell, final String newComment, final CellAttributesMap cellAttributesMap) { if ((newComment == null) || (newComment.isEmpty())) { return; } int widgetStart = newComment .indexOf(TieConstants.METHOD_WIDGET_PREFIX); int elStart = newCommen...
java
{ "resource": "" }
q178835
ParserUtility.getAttributeKeyInMapByCell
test
public static String getAttributeKeyInMapByCell(final Cell cell) { if (cell == null) { return null; } // map's key is sheetName!$columnIndex$rowIndex return cell.getSheet().getSheetName() + "!" + CellUtility.getCellIndexNumberKey(cell); }
java
{ "resource": "" }
q178836
ParserUtility.parseValidateAttributes
test
public static void parseValidateAttributes(final Cell cell, final String newComment, final CellAttributesMap cellAttributesMap) { if ((newComment == null) || (newComment.isEmpty())) { return; } if (!newComment.startsWith(TieConstants.METHOD_VALIDATE_PREFIX)) { return; } String values ...
java
{ "resource": "" }
q178837
ParserUtility.findPairBracketPosition
test
private static int findPairBracketPosition(final String str, final int startPos) { int bracketNum = 0; for (int i = startPos; i < str.length(); i++) { char current = str.charAt(i); if (current == TieConstants.EL_START_BRACKET) { bracketNum++; ...
java
{ "resource": "" }
q178838
ParserUtility.parseCommandAttributes
test
public static Map<String, String> parseCommandAttributes( final String attrString) { Map<String, String> attrMap = new LinkedHashMap<>(); Matcher attrMatcher = TieConstants.ATTR_REGEX_PATTERN .matcher(attrString); while (attrMatcher.find()) { String attrData = attrMatcher.group(); int attrName...
java
{ "resource": "" }
q178839
ParserUtility.parseInputAttributes
test
public static void parseInputAttributes( final List<CellFormAttributes> clist, final String controlAttrs) { // only one type control allowed for one cell. clist.clear(); if (controlAttrs != null) { String[] cattrs = controlAttrs.split( TieConstants.SPLIT_SPACE_SEPERATE_ATTRS_REGX, -1); fo...
java
{ "resource": "" }
q178840
ParserUtility.parseValidateAttributes
test
public static void parseValidateAttributes( final List<CellFormAttributes> clist, final String controlAttrs) { // one cell could have multiple validation rules. if (controlAttrs == null) { return; } String[] cattrs = controlAttrs .split(TieConstants.SPLIT_SPACE_SEPERATE_ATTRS_REGX, -1); ...
java
{ "resource": "" }
q178841
ParserUtility.splitByEualSign
test
private static String[] splitByEualSign(final String attrData) { int attrNameEndIndex = attrData.indexOf('='); if (attrNameEndIndex < 0) { return new String[0]; } String attrName = attrData.substring(0, attrNameEndIndex).trim(); String attrValue = attrData.substring(attrNameEndIndex + 1).trim(); S...
java
{ "resource": "" }
q178842
ParserUtility.parseSpecialAttributes
test
public static void parseSpecialAttributes(final String key, final String type, final List<CellFormAttributes> inputs, final CellAttributesMap cellAttributesMap) { SpecialAttributes sAttr = new SpecialAttributes(); for (CellFormAttributes attr : inputs) { gatherSpecialAttributes(type, sAttr, at...
java
{ "resource": "" }
q178843
ParserUtility.processCalendarAttributes
test
private static void processCalendarAttributes(final String key, final CellAttributesMap cellAttributesMap, final SpecialAttributes sAttr) { cellAttributesMap.getCellDatePattern().put(key, sAttr.defaultDatePattern); }
java
{ "resource": "" }
q178844
ParserUtility.processSelectItemAttributes
test
private static void processSelectItemAttributes(final String key, final CellAttributesMap cellAttributesMap, final SpecialAttributes sAttr) { if ((sAttr.selectValues == null) || (sAttr.selectValues.length != sAttr.selectLabels.length)) { sAttr.selectValues = sAttr.selectLabels; } Map<String, S...
java
{ "resource": "" }
q178845
ParserUtility.gatherSpecialAttributes
test
private static void gatherSpecialAttributes(final String type, final SpecialAttributes sAttr, final CellFormAttributes attr) { String attrKey = attr.getType(); if (attrKey.equalsIgnoreCase(TieConstants.SELECT_ITEM_LABELS)) { sAttr.selectLabels = attr.getValue().split(";"); } if (attrKey.equalsIgnore...
java
{ "resource": "" }
q178846
ParserUtility.parseCommentToMap
test
public static void parseCommentToMap(final String cellKey, final String newComment, final Map<String, Map<String, String>> sheetCommentMap, final boolean normalComment) { if ((newComment != null) && (!newComment.trim().isEmpty())) { // normal comment key is $$ String commentKey = TieConstants.NOR...
java
{ "resource": "" }
q178847
ParserUtility.findFirstNonCellNamePosition
test
public static int findFirstNonCellNamePosition(String input, int startPosition) { char c; for (int i = startPosition; i < input.length(); i++) { c = input.charAt(i); if ( c!='$' && !Character.isLetterOrDigit(c)) { return i; } } return -1; // not found }
java
{ "resource": "" }
q178848
ParserUtility.removeCharsFromString
test
public static String removeCharsFromString(String inputStr, int start, int end) { StringBuilder sb = new StringBuilder(inputStr); sb.delete(start, end); // if ((start > 0) && (inputStr.charAt(start - 1) ==' ')) { // // if end with a space, then remove it as well. // sb.deleteCharAt(sta...
java
{ "resource": "" }
q178849
WebSheetUtility.getExcelColumnName
test
public static String getExcelColumnName(final int pnumber) { StringBuilder converted = new StringBuilder(); // Repeatedly divide the number by 26 and convert the // remainder into the appropriate letter. int number = pnumber; while (number >= 0) { int remainder = number % TieConstants.EXCEL_LETTER_NU...
java
{ "resource": "" }
q178850
WebSheetUtility.convertColToInt
test
public static int convertColToInt(final String col) { String name = col.toUpperCase(); int number = 0; int pow = 1; for (int i = name.length() - 1; i >= 0; i--) { number += (name.charAt(i) - 'A' + 1) * pow; pow *= TieConstants.EXCEL_LETTER_NUMBERS; } return number - 1; }
java
{ "resource": "" }
q178851
WebSheetUtility.getCellByReference
test
public static Cell getCellByReference(final String cellRef, final Sheet sheet) { Cell c = null; try { CellReference ref = new CellReference(cellRef); Row r = sheet.getRow(ref.getRow()); if (r != null) { c = r.getCell(ref.getCol(), MissingCellPolicy.CREATE_NULL_AS_BLANK); } } c...
java
{ "resource": "" }
q178852
WebSheetUtility.heightUnits2Pixel
test
public static int heightUnits2Pixel(final short heightUnits) { int pixels = heightUnits / EXCEL_ROW_HEIGHT_FACTOR; int offsetHeightUnits = heightUnits % EXCEL_ROW_HEIGHT_FACTOR; pixels += Math.round((float) offsetHeightUnits / ((float) EXCEL_COLUMN_WIDTH_FACTOR / UNIT_OFFSET_LENGTH / 2)); pixels...
java
{ "resource": "" }
q178853
WebSheetUtility.isDate
test
public static boolean isDate(final String s) { Pattern pattern = Pattern.compile(DATE_REGEX_4_DIGIT_YEAR); String[] terms = s.split(" "); Matcher matcher; for (String term : terms) { matcher = pattern.matcher(term); if (matcher.matches()) { return true; } } pattern = Pattern.compile(D...
java
{ "resource": "" }
q178854
WebSheetUtility.parseDate
test
public static String parseDate(final String entry) { Pattern pattern = Pattern.compile(DATE_REGEX_4_DIGIT_YEAR); String[] terms = entry.split(" "); Matcher matcher; for (String term : terms) { matcher = pattern.matcher(term); if (matcher.matches()) { return matcher.group(); } } patter...
java
{ "resource": "" }
q178855
WebSheetUtility.isNumeric
test
public static boolean isNumeric(final String str) { String s = str; if (s.startsWith("-")) { s = s.substring(1); } char c; int i; int sLen = s.length(); ShouldContinueParameter sPara = new ShouldContinueParameter(false, false, 0); for (i = 0; i < sLen; i++) { c = s.charAt(i); ...
java
{ "resource": "" }
q178856
WebSheetUtility.shouldContinue
test
private static boolean shouldContinue(final char c, final ShouldContinueParameter para) { if (c == '.' && !para.isDecimalHit()) { para.setDecimalHit(true); if (para.isCommaHit() && para.getSinceLastComma() != 3) { return false; } return true; } else if (c == ',' && !para.isDecimalHit()) {...
java
{ "resource": "" }
q178857
WebSheetUtility.setObjectProperty
test
public static void setObjectProperty(final Object obj, final String propertyName, final String propertyValue, final boolean ignoreNonExisting) { try { Method method = obj.getClass().getMethod( "set" + Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1), new Class...
java
{ "resource": "" }
q178858
WebSheetUtility.cellCompareTo
test
public static int cellCompareTo(final Cell thisCell, final Cell otherCell) { int r = thisCell.getRowIndex() - otherCell.getRowIndex(); if (r != 0) { return r; } r = thisCell.getColumnIndex() - otherCell.getColumnIndex(); if (r != 0) { return r; } return 0; }
java
{ "resource": "" }
q178859
WebSheetUtility.insideRange
test
public static boolean insideRange(final ConfigRange child, final ConfigRange parent) { return ((cellCompareTo(child.getFirstRowRef(), parent.getFirstRowRef()) >= 0) && (cellCompareTo(child.getLastRowPlusRef(), parent.getLastRowPlusRef()) <= 0)); }
java
{ "resource": "" }
q178860
WebSheetUtility.clearHiddenColumns
test
public static void clearHiddenColumns(final Sheet sheet) { for (Row row : sheet) { if (row.getLastCellNum() > TieConstants.MAX_COLUMNS_IN_SHEET) { deleteHiddenColumnsInRow(row); } } }
java
{ "resource": "" }
q178861
WebSheetUtility.deleteHiddenColumnsInRow
test
private static void deleteHiddenColumnsInRow(final Row row) { deleteCellFromRow(row, TieConstants.HIDDEN_SAVE_OBJECTS_COLUMN); deleteCellFromRow(row, TieConstants.HIDDEN_ORIGIN_ROW_NUMBER_COLUMN); deleteCellFromRow(row, TieConstants.HIDDEN_FULL_NAME_COLUMN); }
java
{ "resource": "" }
q178862
WebSheetUtility.deleteCellFromRow
test
private static void deleteCellFromRow(final Row row, final int cellNum) { Cell cell = row.getCell(cellNum); if (cell != null) { row.removeCell(cell); } }
java
{ "resource": "" }
q178863
PostConstructApplicationEventListener.processEvent
test
@Override public final void processEvent(final SystemEvent event) { LOGGER.log(Level.INFO, "Running on TieFaces {0}", AppUtils.getBuildVersion()); }
java
{ "resource": "" }
q178864
ValidationHandler.refreshAfterStatusChanged
test
private void refreshAfterStatusChanged(final boolean oldStatus, final boolean newStatus, final int formRow, final int formCol, final FacesCell cell, final boolean updateGui) { if (!newStatus) { cell.setErrormsg(""); } cell.setInvalid(newStatus); if (updateGui && (oldStatus != newStatus) && (parent...
java
{ "resource": "" }
q178865
ValidationHandler.validateWithRowColInCurrentPage
test
public boolean validateWithRowColInCurrentPage(final int row, final int col, boolean updateGui) { //until now passEmptyCheck has one to one relation to submitMode //e.g. when passEmptyCheck = false, then submitMode = true. boolean submitMode = parent.getSubmitMode(); boolean passEmptyCheck = !submitMo...
java
{ "resource": "" }
q178866
ValidationHandler.validateByTieWebSheetValidationBean
test
private boolean validateByTieWebSheetValidationBean(final Cell poiCell, final int topRow, final int leftCol, final FacesCell cell, final String value, boolean updateGui) { if (parent.getTieWebSheetValidationBean() != null) { String errormsg = null; String fullName = ConfigurationUtility.getFullNameFromRo...
java
{ "resource": "" }
q178867
ValidationHandler.checkErrorMessageFromObjectInContext
test
private boolean checkErrorMessageFromObjectInContext(final int formRow, final int formCol, final FacesCell cell, final Cell poiCell, final String value, final SheetConfiguration sheetConfig, boolean updateGui) { @SuppressWarnings("unchecked") HashMap<String, TieCell> tieCells = (HashMap<String, TieCell>) pa...
java
{ "resource": "" }
q178868
ValidationHandler.validateAllRulesForSingleCell
test
private boolean validateAllRulesForSingleCell(final int formRow, final int formCol, final FacesCell cell, final Cell poiCell, final String value, final SheetConfiguration sheetConfig, final List<CellFormAttributes> cellAttributes, boolean updateGui) { Sheet sheet1 = parent.getWb().getSheet(sheetConfig.getShe...
java
{ "resource": "" }
q178869
ValidationHandler.doValidation
test
private boolean doValidation(final Object value, final CellFormAttributes attr, final int rowIndex, final int colIndex, final Sheet sheet) { boolean pass; String attrValue = attr.getValue(); attrValue = attrValue.replace("$value", value.toString() + "").replace("$rowIndex", rowIndex + "") .replace("...
java
{ "resource": "" }
q178870
ValidationHandler.validateCell
test
public final boolean validateCell(final UIComponent target) { int[] rowcol = CellUtility.getRowColFromComponentAttributes(target); int row = rowcol[0]; int col = rowcol[1]; return validateWithRowColInCurrentPage(row, col, true); }
java
{ "resource": "" }
q178871
ValidationHandler.validateCurrentPage
test
public final boolean validateCurrentPage() { boolean allpass = true; int top = parent.getCurrent().getCurrentTopRow(); for (int irow = 0; irow < parent.getBodyRows().size(); irow++) { if (!validateRowInCurrentPage(irow + top, false)) { allpass = false; } } return allpass; }
java
{ "resource": "" }
q178872
ValidationHandler.validateRowInCurrentPage
test
public final boolean validateRowInCurrentPage(final int irow, final boolean updateGui) { SheetConfiguration sheetConfig = parent.getSheetConfigMap().get(parent.getCurrent().getCurrentTabName()); return this.validateRow(irow, sheetConfig, updateGui); }
java
{ "resource": "" }
q178873
ValidationHandler.validateRow
test
private boolean validateRow(final int irow, final SheetConfiguration sheetConfig, boolean updateGui) { boolean pass = true; if (sheetConfig == null) { return pass; } int top = sheetConfig.getBodyCellRange().getTopRow(); List<FacesCell> cellRow = parent.getBodyRows().get(irow - top).getCells(); for...
java
{ "resource": "" }
q178874
ValidationHandler.refreshCachedCellsInCurrentPage
test
private void refreshCachedCellsInCurrentPage(final FacesContext facesContext, final String tblName) { // refresh current page calculation fields UIComponent s = facesContext.getViewRoot().findComponent(tblName); if (s == null) { return; } DataTable webDataTable = (DataTable) s; int first = webData...
java
{ "resource": "" }
q178875
ValidationHandler.refreshCachedCellsInRow
test
private void refreshCachedCellsInRow(final String tblName, final int top, final int left, final int i) { FacesRow dataRow = parent.getBodyRows().get(i); int isize = dataRow.getCells().size(); for (int index = 0; index < isize; index++) { FacesCell fcell = dataRow.getCells().get(index); Cell poiCell = p...
java
{ "resource": "" }
q178876
ValidationHandler.setSubmitModeInView
test
public void setSubmitModeInView(final Boolean fullflag) { if (FacesContext.getCurrentInstance() != null) { Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap(); if (viewMap != null) { Boolean flag = (Boolean) viewMap.get(TieConstants.SUBMITMODE); if ((flag ==...
java
{ "resource": "" }
q178877
ValidationHandler.preValidation
test
public boolean preValidation() { String currentTabName = parent.getCurrent().getCurrentTabName(); String tabName = null; String firstInvalidTabName = null; boolean reload = false; for (Map.Entry<String, SheetConfiguration> entry : parent.getSheetConfigMap().entrySet()) { tabName = entry.getKey(...
java
{ "resource": "" }
q178878
CellAttributesMap.clear
test
public final void clear() { if (this.templateCommentMap != null) { this.templateCommentMap.clear(); } if (this.cellDatePattern != null) { this.cellDatePattern.clear(); } if (this.cellInputAttributes != null) { this.cellInputAttributes.clear(); } if (this.cellInputType != null) { thi...
java
{ "resource": "" }
q178879
WebSheetLoader.loadHeaderRows
test
private void loadHeaderRows(final SheetConfiguration sheetConfig, final Map<String, CellRangeAddress> cellRangeMap, final List<String> skippedRegionCells) { int top = sheetConfig.getHeaderCellRange().getTopRow(); int bottom = sheetConfig.getHeaderCellRange().getBottomRow(); int left = sheetConfig.getHead...
java
{ "resource": "" }
q178880
WebSheetLoader.loadHeaderRowWithoutConfigurationTab
test
private List<HeaderCell> loadHeaderRowWithoutConfigurationTab(final RangeBuildRef rangeBuildRef, final boolean rendered) { int firstCol = rangeBuildRef.getLeft(); int lastCol = rangeBuildRef.getRight(); double totalWidth = (double) rangeBuildRef.getTotalWidth(); Sheet sheet1 = rangeBuildRef.getSheet()...
java
{ "resource": "" }
q178881
WebSheetLoader.fillToMaxColumns
test
private void fillToMaxColumns(final List<HeaderCell> headercells) { if (headercells.size() < parent.getMaxColCounts()) { int fills = parent.getMaxColCounts() - headercells.size(); for (int s = 0; s < fills; s++) { headercells.add(new HeaderCell("1", "1", "", "", "", false, false)); } } }
java
{ "resource": "" }
q178882
WebSheetLoader.getHeaderColumnStyle
test
private String getHeaderColumnStyle(final Workbook wb, final Cell cell, final double colWidth, final double totalWidth) { String columnstyle = ""; if (cell != null) { columnstyle += CellStyleUtility.getCellStyle(wb, cell, "") + CellStyleUtility.getCellFontStyle(wb, cell); // + } columnstyle = co...
java
{ "resource": "" }
q178883
WebSheetLoader.getWidthStyle
test
private String getWidthStyle(final double colWidth, final double totalWidth) { double percentage = FacesUtility.round(TieConstants.CELL_FORMAT_PERCENTAGE_VALUE * colWidth / totalWidth, 2); return "width:" + percentage + TieConstants.CELL_FORMAT_PERCENTAGE_SYMBOL + ";"; }
java
{ "resource": "" }
q178884
WebSheetLoader.loadHeaderRowWithConfigurationTab
test
private List<HeaderCell> loadHeaderRowWithConfigurationTab(final SheetConfiguration sheetConfig, final RangeBuildRef rangeBuildRef, final int currentRow, final Map<String, CellRangeAddress> cellRangeMap, final List<String> skippedRegionCells) { Sheet sheet1 = rangeBuildRef.getSheet(); int left = rangeBu...
java
{ "resource": "" }
q178885
WebSheetLoader.getColumnWidthStyle
test
private String getColumnWidthStyle(final Sheet sheet1, final Map<String, CellRangeAddress> cellRangeMap, final String cellindex, final int cindex, final double totalWidth) { CellRangeAddress caddress = cellRangeMap.get(cellindex); double colWidth; // check whether the cell has rowspan or colspan if (c...
java
{ "resource": "" }
q178886
WebSheetLoader.clearWorkbook
test
private void clearWorkbook() { parent.setFormulaEvaluator(null); parent.setDataFormatter(null); parent.setSheetConfigMap(null); parent.setTabs(null); parent.getSerialDataContext().setDataContext(null); parent.setPicturesMap(null); parent.setHeaderRows(null); parent.setBodyRows(null); parent.s...
java
{ "resource": "" }
q178887
WebSheetLoader.initTabs
test
private void initTabs() { parent.setTabs(new ArrayList<TabModel>()); if (parent.getSheetConfigMap() != null) { for (String key : parent.getSheetConfigMap().keySet()) { parent.getTabs().add(new TabModel("form_" + key, key, "form")); } } }
java
{ "resource": "" }
q178888
WebSheetLoader.loadData
test
private void loadData() { if (parent.getSerialDataContext().getDataContext() == null) { // no data objects available. return; } if (parent.isAdvancedContext()) { parent.getSerialDataContext().getDataContext().put("tiecells", new HashMap<String, TieCell>()); } for (SheetConfiguration she...
java
{ "resource": "" }
q178889
WebSheetLoader.refreshData
test
public void refreshData() { if (parent.getSerialDataContext().getDataContext() == null) { // no data objects available. return; } for (SheetConfiguration sheetConfig : parent.getSheetConfigMap().values()) { for (int irow = sheetConfig.getFormCommand().getTopRow(); irow < sheetConfig.getFormComm...
java
{ "resource": "" }
q178890
WebSheetLoader.refreshDataForRow
test
private void refreshDataForRow(Row row) { if (row == null) { return; } String saveAttrList = SaveAttrsUtility.getSaveAttrListFromRow(row); if (saveAttrList!= null) { String[] saveAttrs = saveAttrList.split(","); for (String fullSaveAttr : saveAttrs) { refreshDataForCell(row, fullSaveAttr); ...
java
{ "resource": "" }
q178891
WebSheetLoader.refreshDataForCell
test
private void refreshDataForCell(Row row, String fullSaveAttr) { if (fullSaveAttr != null) { try { String fullName = ConfigurationUtility.getFullNameFromRow(row); if (fullName != null) { parent.getCellHelper().restoreDataContext(fullName); SaveAttrsUtility.refreshSheetRowFromContext(parent.g...
java
{ "resource": "" }
q178892
WebSheetLoader.findTabIndexWithName
test
public final int findTabIndexWithName(final String tabname) { for (int i = 0; i < parent.getTabs().size(); i++) { if (parent.getTabs().get(i).getTitle().equalsIgnoreCase(tabname)) { return i; } } return -1; }
java
{ "resource": "" }
q178893
WebSheetLoader.loadWorkSheet
test
public final void loadWorkSheet(final String tabName) { prepareWorkShee(tabName); parent.getValidationHandler().validateCurrentPage(); createDynamicColumns(tabName); // reset datatable current page to 1 setDataTablePage(0); parent.getCurrent().setCurrentDataContextName(null); saveObjs(); if ((...
java
{ "resource": "" }
q178894
WebSheetLoader.prepareWorkShee
test
public final void prepareWorkShee(final String tabName) { int tabIndex = findTabIndexWithName(tabName); if (parent.getWebFormTabView() != null) { parent.getWebFormTabView().setActiveIndex(tabIndex); } parent.getCurrent().setCurrentTabName(tabName); String sheetName = parent.getSheetConfigMap().get(...
java
{ "resource": "" }
q178895
WebSheetLoader.setDataTablePage
test
private void setDataTablePage(final int first) { if (parent.getWebFormClientId() != null) { final DataTable d = (DataTable) FacesContext.getCurrentInstance().getViewRoot() .findComponent(parent.getWebFormClientId()); if (d != null) { d.setFirst(first); } } }
java
{ "resource": "" }
q178896
WebSheetLoader.saveObjs
test
private void saveObjs() { try { if (FacesContext.getCurrentInstance() != null) { Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap(); viewMap.put("currentTabName", parent.getCurrent().getCurrentTabName()); viewMap.put(TieConstants.SUBMITMODE, parent.getSubm...
java
{ "resource": "" }
q178897
WebSheetLoader.setupRowInfo
test
private void setupRowInfo(final FacesRow facesRow, final Sheet sheet1, final Row row, final int rowIndex, final boolean allowAdd) { facesRow.setAllowAdd(allowAdd); if (row != null) { facesRow.setRendered(!row.getZeroHeight()); facesRow.setRowheight(row.getHeight()); int rowNum = ConfigurationUti...
java
{ "resource": "" }
q178898
WebSheetLoader.loadBodyRows
test
private void loadBodyRows(final SheetConfiguration sheetConfig, final Map<String, CellRangeAddress> cellRangeMap, final List<String> skippedRegionCells) { int top = sheetConfig.getBodyCellRange().getTopRow(); int bottom = CellUtility.getBodyBottomFromConfig(sheetConfig); int left = sheetConfig.getBodyCel...
java
{ "resource": "" }
q178899
WebSheetLoader.assembleFacesBodyRow
test
private FacesRow assembleFacesBodyRow(final int rowIndex, final Sheet sheet1, final int left, final int right, final SheetConfiguration sheetConfig, final Map<String, CellRangeAddress> cellRangeMap, final List<String> skippedRegionCells) { FacesRow facesRow = new FacesRow(rowIndex); Row row = sheet1.get...
java
{ "resource": "" }