Package com._1c.g5.v8.dt.qw.ui.utils
Class SpreadsheetUtils
java.lang.Object
com._1c.g5.v8.dt.qw.ui.utils.SpreadsheetUtils
Spreadsheet utilities methods
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic Pair<SpreadsheetDocument,
BasicTemplate> buildDocument
(String templateName, org.eclipse.emf.ecore.EObject mdObject, boolean isReplaceTemplate) Make new spreadsheet documentstatic void
closeEditor
(org.eclipse.emf.ecore.EObject object) Close opened editor with objectstatic Column
createColumn
(SheetAccessor sheet, int width) Create column from sheet accessorstatic BasicTemplate
findTemplateWithName
(org.eclipse.emf.ecore.EObject mdObject, org.eclipse.emf.ecore.EReference reference, String templateName) Find template with namestatic int
getColumnWidth
(TypeDescription type, int minWidth) Calculate column width for given typestatic String
getDataFormat
(TypeDescription type, ScriptVariant scriptVariant) Get text format for typestatic String
getText
(String text, String textRu, ScriptVariant scriptVariant) Get text depended from script variantstatic void
openEditor
(org.eclipse.emf.ecore.EObject object) Open editor with objectstatic void
saveDocument
(SpreadsheetDocument spreadsheetDocument) Save documentstatic void
setCellText
(SheetAccessor sheet, int row, int column, String text, FillType fillType, boolean isBoold, int border, String dataFormat, int autoIndent, String detailParameter) Set cell textstatic void
setCellText
(SheetAccessor sheet, SpreadsheetUtils.TextParams textParams) Set cell textstatic void
setColumnWidth
(SheetAccessor sheet, int width, int columnIndex, int rowIndex, int rowsCount) Set column width
-
Field Details
-
NONE_BORDER
public static final int NONE_BORDER- See Also:
-
LEFT_BORDER
public static final int LEFT_BORDER- See Also:
-
RIGHT_BORDER
public static final int RIGHT_BORDER- See Also:
-
TOP_BORDER
public static final int TOP_BORDER- See Also:
-
BOTTOM_BORDER
public static final int BOTTOM_BORDER- See Also:
-
ALL_BORDERS
public static final int ALL_BORDERS- See Also:
-
UNLIMITED_WIDTH
public static final int UNLIMITED_WIDTH- See Also:
-
-
Method Details
-
buildDocument
public static Pair<SpreadsheetDocument,BasicTemplate> buildDocument(String templateName, org.eclipse.emf.ecore.EObject mdObject, boolean isReplaceTemplate) Make new spreadsheet document- Parameters:
templateName
- - namemdObject
- - parent mdobjectisReplaceTemplate
- - replace exist template- Returns:
- pair with SpreadsheetDocument and BasicTemplate
-
setCellText
public static void setCellText(SheetAccessor sheet, int row, int column, String text, FillType fillType, boolean isBoold, int border, String dataFormat, int autoIndent, String detailParameter) Set cell text- Parameters:
sheet
- - sheet accessorrow
- - rowcolumn
- - columntext
- - textfillType
- - fill typeisBoold
- - is text boldborder
- - bordersdataFormat
- - data formatautoIndent
- - auto indentdetailParameter
- - detail parameter
-
setCellText
Set cell text- Parameters:
sheet
- - sheet accessortextParams
- - text parameters
-
getColumnWidth
Calculate column width for given type- Parameters:
type
- - typeminWidth
- - minimum width- Returns:
- width
-
getDataFormat
Get text format for type- Parameters:
type
- - typescriptVariant
- - Script variant- Returns:
- text format
-
setColumnWidth
public static void setColumnWidth(SheetAccessor sheet, int width, int columnIndex, int rowIndex, int rowsCount) Set column width- Parameters:
sheet
- - sheet accessorwidth
- - widthcolumnIndex
- - column indexrowIndex
- - row indexrowsCount
- - rows count
-
createColumn
Create column from sheet accessor- Parameters:
sheet
- - sheet accessorwidth
- - width- Returns:
- column
-
saveDocument
Save document- Parameters:
spreadsheetDocument
- - spreadsheet document
-
openEditor
public static void openEditor(org.eclipse.emf.ecore.EObject object) Open editor with object- Parameters:
object
- - object
-
closeEditor
public static void closeEditor(org.eclipse.emf.ecore.EObject object) Close opened editor with object- Parameters:
object
- - object in editor
-
findTemplateWithName
public static BasicTemplate findTemplateWithName(org.eclipse.emf.ecore.EObject mdObject, org.eclipse.emf.ecore.EReference reference, String templateName) Find template with name- Parameters:
mdObject
- - MdObjectreference
- - reference with templatestemplateName
- - template name- Returns:
- template or null
-
getText
Get text depended from script variant- Parameters:
text
- - default texttextRu
- - russian textscriptVariant
- - script variant- Returns:
- text
-