Class EquationFunctionArgumentSeparator

EquationFunctionArgumentSeparator

Element reprezentujący separator funkcji w matematyce Equation. Element EquationFunctionArgumentSeparator nie może zawierać żadnego innego elementu. Więcej informacji o strukturze dokumentów znajdziesz w przewodniku po rozszerzaniu Dokumentów Google.

Metody

MetodaZwracany typKrótki opis
copy()EquationFunctionArgumentSeparatorZwraca odłączoną, głęboką kopię bieżącego elementu.
getAttributes()ObjectPobiera atrybuty elementu.
getNextSibling()ElementPobiera następny element równorzędny elementu.
getParent()ContainerElementPobiera element nadrzędny elementu.
getPreviousSibling()ElementPobiera poprzedni element równorzędny.
getType()ElementTypePobiera ElementType elementu.
isAtDocumentEnd()BooleanOkreśla, czy element znajduje się na końcu parametru Document.
merge()EquationFunctionArgumentSeparatorŁączy element z poprzednim elementem równorzędnym tego samego typu.
removeFromParent()EquationFunctionArgumentSeparatorUsuwa element z elementu nadrzędnego.
setAttributes(attributes)EquationFunctionArgumentSeparatorUstawia atrybuty elementu.

Szczegółowa dokumentacja

copy()

Zwraca odłączoną, głęboką kopię bieżącego elementu.

Kopiowane są też wszystkie elementy podrzędne występujące w elemencie. Nowy element nie ma elementu nadrzędnego.

Powroty

EquationFunctionArgumentSeparator – nowa kopia.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getAttributes()

Pobiera atrybuty elementu.

W efekcie powstanie obiekt zawierający właściwość każdego prawidłowego atrybutu elementu, w którym każda nazwa właściwości odpowiada elementowi w wyliczeniu DocumentApp.Attribute.

var body = DocumentApp.getActiveDocument().getBody();

// Append a styled paragraph.
var par = body.appendParagraph('A bold, italicized paragraph.');
par.setBold(true);
par.setItalic(true);

// Retrieve the paragraph's attributes.
var atts = par.getAttributes();

// Log the paragraph attributes.
for (var att in atts) {
  Logger.log(att + ":" + atts[att]);
}

Powroty

Object – atrybuty elementu.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getNextSibling()

Pobiera następny element równorzędny elementu.

Następne elementy nadrzędne mają ten sam element nadrzędny i następują po bieżącym elemencie.

Powroty

Element – następny element równorzędny.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getParent()

Pobiera element nadrzędny elementu.

Element nadrzędny zawiera element bieżący.

Powroty

ContainerElement – element nadrzędny.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getPreviousSibling()

Pobiera poprzedni element równorzędny.

Poprzedni element nadrzędny ma ten sam element nadrzędny i poprzedza bieżący element.

Powroty

Element – poprzedni element równorzędny.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

getType()

Pobiera ElementType elementu.

Użyj właściwości getType(), aby określić dokładny typ danego elementu.

var body = DocumentApp.getActiveDocument().getBody();

// Obtain the first element in the document body.

var firstChild = body.getChild(0);

// Use getType() to determine the element's type.
if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) {
  Logger.log('The first element is a paragraph.');
} else {
  Logger.log('The first element is not a paragraph.');
}

Powroty

ElementType – typ elementu.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

isAtDocumentEnd()

Określa, czy element znajduje się na końcu parametru Document.

Powroty

Boolean – określa, czy element znajduje się na końcu dokumentu.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

merge()

Łączy element z poprzednim elementem równorzędnym tego samego typu.

Można scalać tylko elementy elementu ElementType. Wszystkie elementy podrzędne zawarte w bieżącym elemencie są przenoszone do poprzedniego elementu równorzędnego.

Bieżący element zostanie usunięty z dokumentu.

var body = DocumentApp.getActiveDocument().getBody();
// Example 1: Merge paragraphs
// Append two paragraphs to the document.
var par1 = body.appendParagraph('Paragraph 1.');
var par2 = body.appendParagraph('Paragraph 2.');
// Merge the newly added paragraphs into a single paragraph.
par2.merge();

// Example 2: Merge table cells
// Create a two-dimensional array containing the table's cell contents.
var cells = [
['Row 1, Cell 1', 'Row 1, Cell 2'],
['Row 2, Cell 1', 'Row 2, Cell 2']
];
// Build a table from the array.
var table = body.appendTable(cells);
// Get the first row in the table.
 var row = table.getRow(0);
// Get the two cells in this row.
var cell1 = row.getCell(0);
var cell2 = row.getCell(1);
// Merge the current cell into its preceding sibling element.
var merged = cell2.merge();

Powroty

EquationFunctionArgumentSeparator – scalony element.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

removeFromParent()

Usuwa element z elementu nadrzędnego.

var body = DocumentApp.getActiveDocument().getBody();

// Remove all images in the document body.
var imgs = body.getImages();
for (var i = 0; i < imgs.length; i++) {
  imgs[i].removeFromParent();
}

Powroty

EquationFunctionArgumentSeparator – usunięty element

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents

setAttributes(attributes)

Ustawia atrybuty elementu.

Określony parametr atrybutów musi być obiektem, w którym każda nazwa właściwości jest elementem w wyliczeniu DocumentApp.Attribute, a każda wartość właściwości jest nową wartością do zastosowania.

var body = DocumentApp.getActiveDocument().getBody();

// Define a custom paragraph style.
var style = {};
style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
    DocumentApp.HorizontalAlignment.RIGHT;
style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
style[DocumentApp.Attribute.FONT_SIZE] = 18;
style[DocumentApp.Attribute.BOLD] = true;

// Append a plain paragraph.
var par = body.appendParagraph('A paragraph with custom style.');

// Apply the custom style.
par.setAttributes(style);

Parametry

NazwaTypOpis
attributesObjectAtrybuty elementu.

Powroty

EquationFunctionArgumentSeparator – bieżący element.

Upoważnienie

Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:

  • https://www.googleapis.com/auth/documents.currentonly
  • https://www.googleapis.com/auth/documents