概述 | 软件包 | 类 | 树 | 索引 | 帮助

上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法

## application.workbooks.workbook.documents.document.view
类 OutlineView

    java.lang.Object
      application.workbooks.workbook.documents.document.view.NormalView
          application.workbooks.workbook.documents.document.view.OutlineView

    public class OutlineView

extends NormalView

该类定义了对大纲文档视图进行操作的一些方法。

方法摘要
`void` | `collapse(long startOffset, long length)` 在大纲视图中折叠某一标题下的子标题和文本。
`void` | `collapseParagraphs(int paragraphStartIndex, int paragraphEndIndex)` 在大纲视图中折叠某一标题下的子标题和文本。
`void` | `demote(long startOffset, long length)` 把指定的字符串降级。
`void` | `demoteParagraph(int paragraphIndex)` 将指定的段落降级。
`void` | `demoteParagraph(int paragraphStartIndex, int paragraphEndIndex)` 将指定的段落范围降级。
`void` | `demoteToBobyText(long startOffset, long length)` 将指定的字符串所在段落降级至正文。
`void` | `demoteToBobyTextPara(int paragraphIndex)` 将指定的段落降级至正文。
`void` | `demoteToBobyTextPara(int paragraphStartIndex, int paragraphEndIndex)` 将指定的段落范围降级至正文。
`void` | `expand(long startOffset, long length)` 在大纲视图中展开指定字符串所在段落的标题下被折叠的子标题和文本。
`void` | `expandParagraphs(int paragraphStartIndex, int paragraphEndIndex)` 在大纲视图中展开指定段落范围内标题下被折叠的子标题和文本。
`int` | `getViewType()` 返回当前的视图类型。
`void` | `promote(long startOffset, long length)` 将指定的字符串所在段落升级。
`void` | `promoteParagraph(int paragraphIndex)` 将指定的段落升级。
`void` | `promoteParagraph(int paragraphStartIndex, int paragraphEndIndex)` 将指定范围的段落升级。
`void` | `showAllHeadings()` 在大纲视图中显示所有标题段落。
`void` | `showFormating(boolean showFormat)` 显示大纲视图下的格式。
`void` | `showOutlineLevel(int level)` 在大纲视图中显示指定级别的标题段落。

从类 application.workbooks.workbook.documents.document.view.NormalView 继承的方法
`getZoom, isHorizontalScrollBarVisible, isVerticalScrollBarVisible, setHorizontalScrollBarVisible, setMarkVisible, setVerticalScrollBarVisible, setZoom`

从类 java.lang.Object 继承的方法
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

方法详细信息

### collapse

    public void collapse(long startOffset,
                         long length)

  在大纲视图中折叠某一标题下的子标题和文本。

  参数：
    `startOffset` - 光标的起始位置
    `length` - 需要折叠的长度

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.collapse(doc.getOffset(),(doc.getLength() - doc.getOffset()));

  抛出：
    `MacroRunException` - 当参数startOffset超出范围时
    `MacroRunException` - 当参数length超出范围时

### collapseParagraphs

    public void collapseParagraphs(int paragraphStartIndex,
                                   int paragraphEndIndex)

  在大纲视图中折叠某一标题下的子标题和文本。

  参数：
    `paragraphStartIndex` - 段落的开始索引
    `paragraphEndIndex` - 段落的结束索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.collapseParagraphs(0,1);

  抛出：
    `MacroRunException` - 当参数paragraphStartIndex越界时
    `MacroRunException` - 当参数paragraphEndIndex越界时

### demote

    public void demote(long startOffset,
                       long length)

  把指定的字符串降级。

  参数：
    `startOffset` - 光标的起始位置
    `length` - 需要降级的字符串长度

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.demote(doc.getOffset(),(doc.getLength() - doc.getOffset()));

  抛出：
    `MacroRunException` - 当参数startOffset超出范围时
    `MacroRunException` - 当参数length超出范围时

### demoteParagraph

    public void demoteParagraph(int paragraphIndex)

  将指定的段落降级。

  参数：
    `paragraphIndex` - 段落索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.demoteParagraph(1);

  抛出：
    `MacroRunException` - 当参数paragraphIndex超出范围时

### demoteParagraph

    public void demoteParagraph(int paragraphStartIndex,
                                int paragraphEndIndex)

  将指定的段落范围降级。

  参数：
    `paragraphStartIndex` - 段落的开始索引
    `paragraphEndIndex` - 段落的结束索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.demoteParagraph(0,1);

  抛出：
    `MacroRunException` - 当参数paragraphStartIndex超出范围时
    `MacroRunException` - 当参数paragraphEndIndex超出范围时

### demoteToBobyText

    public void demoteToBobyText(long startOffset,
                                 long length)

  将指定的字符串所在段落降级至正文。

  参数：
    `startOffset` - 光标的起始位置
    `length` - 需要降级的字符串长度

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.demoteToBobyText(doc.getOffset(),(doc.getLength() - doc.getOffset()));

  抛出：
    `MacroRunException` - 当参数startOffset超出范围时
    `MacroRunException` - 当参数length超出范围时

### demoteToBobyTextPara

    public void demoteToBobyTextPara(int paragraphIndex)

  将指定的段落降级至正文。

  参数：
    `paragraphIndex` - 段落索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.demoteToBobyTextPara(1);

  抛出：
    `MacroRunException` - 当参数paragraphIndex超出范围时

### demoteToBobyTextPara

    public void demoteToBobyTextPara(int paragraphStartIndex,
                                     int paragraphEndIndex)

  将指定的段落范围降级至正文。

  参数：
    `paragraphStartIndex` - 段落的开始索引
    `paragraphEndIndex` - 段落的结束索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.promoteParagraph(0);
         outlineView.demoteParagraph(1);
         outlineView.demoteToBobyTextPara(0,1);

  抛出：
    `MacroRunException` - 当参数paragraphStartIndex超出范围时
    `MacroRunException` - 当参数paragraphEndIndex超出范围时

### expand

    public void expand(long startOffset,
                       long length)

  在大纲视图中展开指定字符串所在段落的标题下被折叠的子标题和文本。

  参数：
    `startOffset` - 光标的起始位置
    `length` - 需要展开的字符串长度

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.expand(doc.getOffset(),(doc.getLength() - doc.getOffset()));

  抛出：
    `MacroRunException` - 当参数startOffset越界时
    `MacroRunException` - 当参数length越界时

### expandParagraphs

    public void expandParagraphs(int paragraphStartIndex,
                                 int paragraphEndIndex)

  在大纲视图中展开指定段落范围内标题下被折叠的子标题和文本。

  参数：
    `paragraphStartIndex` - 段落的开始索引
    `paragraphEndIndex` - 段落的结束索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.promoteParagraph(0);
         outlineView.demoteParagraph(1);
         outlineView.expandParagraphs(0,1);

  抛出：
    `MacroRunException` - 当参数paragraphStartIndex越界时
    `MacroRunException` - 当参数paragraphEndIndex越界时

### getViewType

    public int getViewType()

  返回当前的视图类型。

  覆盖：
    类 `NormalView` 中的 `getViewType`
  返回：
    视图类型

    例子:

         //请输入一些文字。
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument();
         DocumentView docView = doc.getDocumentView();
         OutlineView pageView = docView.getOutlineView();
         System.out.println("得到当前文档视图的类型是："+pageView.getViewType());

### promote

    public void promote(long startOffset,
                        long length)

  将指定的字符串所在段落升级。

  参数：
    `startOffset` - 光标的起始位置
    `length` - 需要升级的字符串长度

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.promote(doc.getOffset(),(doc.getLength() - doc.getOffset()));

  抛出：
    `MacroRunException` - 当参数startOffset,length越界时

### promoteParagraph

    public void promoteParagraph(int paragraphIndex)

  将指定的段落升级。

  参数：
    `paragraphIndex` - 段落索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.promoteParagraph(1);

  抛出：
    `MacroRunException` - 当参数paragrapIndex超出范围时

### promoteParagraph

    public void promoteParagraph(int paragraphStartIndex,
                                 int paragraphEndIndex)

  将指定范围的段落升级。

  参数：
    `paragraphStartIndex` - 段落的开始索引
    `paragraphEndIndex` - 段落的结束索引

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.promoteParagraph(0,1);

  抛出：
    `MacroRunException` - 当参数paragraphStartIndex超出范围时
    `MacroRunException` - 当参数paragraphEndIndex超出范围时

### showAllHeadings

    public void showAllHeadings()

  在大纲视图中显示所有标题段落。

  例子:

       Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
            .getActiveDocument();
       BaseText baseText = doc.getSection(0).getBaseText();
       baseText.insertText(0,"this is a test!\n this is a test!");
       DocumentView view = doc.getDocumentView();
       OutlineView outlineView = view.getOutlineView();
       outlineView.showHeading(OutlineLevelConstants.OUT_LINE_LEVEL1);
       outlineView.showAllHeadings();

### showFormating

    public void showFormating(boolean showFormat)

  显示大纲视图下的格式。

  参数：
    `showFormat` - 布尔型，是否显示格式。如果为true表示显示格式；为false表示不显示格式

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.showHeading(OutlineLevelConstants.OUT_LINE_LEVEL1);
         outlineView.showFormating(false);

### showOutlineLevel

    public void showOutlineLevel(int level)

  在大纲视图中显示指定级别的标题段落。

  参数：
    `level` - 标题级别 常量如下：

         OutlineLevelConstants.OUT_LINE_LEVEL1  大纲级别1
         OutlineLevelConstants.OUT_LINE_LEVEL2  大纲级别2
         OutlineLevelConstants.OUT_LINE_LEVEL3  大纲级别3
         OutlineLevelConstants.OUT_LINE_LEVEL4  大纲级别4
         OutlineLevelConstants.OUT_LINE_LEVEL5  大纲级别5
         OutlineLevelConstants.OUT_LINE_LEVEL6  大纲级别6
         OutlineLevelConstants.OUT_LINE_LEVEL7  大纲级别7
         OutlineLevelConstants.OUT_LINE_LEVEL8  大纲级别8
         OutlineLevelConstants.OUT_LINE_LEVEL9  大纲级别9
         OutlineLevelConstants.OUT_LINE_LEVEL_BODY_TEXT  所有大纲级别

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         BaseText baseText = doc.getSection(0).getBaseText();
         baseText.insertText(0,"this is a test!\n this is a test!");
         DocumentView view = doc.getDocumentView();
         OutlineView outlineView = view.getOutlineView();
         outlineView.showOutlineLevel(OutlineLevelConstants.OUT_LINE_LEVEL1);

  抛出：
    `MacroRunException` - 指定的级别不存在
  另请参见：
    `OutlineLevelConstants`

概述 | 软件包 | 类 | 树 | 索引 | 帮助

上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法

版权所有 2001-2008 无锡永中科技有限公司