Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER Copyright 2011 IBM. All rights reserved. Use is subject to license terms. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also obtain a copy of the License at http://odftoolkit.org/docs/license.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 package org.odftoolkit.simple.common.field;
 
ChapterField is placed inside a header or footer, it displays the current chapter name or number on every page.

NOTE: Before the document is opened in any editor, the value of this field maybe invalid.

Since:
0.5
 
 public class ChapterField extends Field {
 
A DisplayType specifies the information that a chapter field should display.

Since:
0.5
 
 	public static enum DisplayType {
 
 		NAME("name"), 
 		NUMBER("number"), 
 		NUMBER_AND_NAME("number-and-name"), 
 		PLAIN_NUMBER("plain-number"), 
 		PLAIN_NUMBER_AND_NAME("plain-number-and-name");
 
 		private final String displayType;
 
 		DisplayType(String type) {
 			 = type;
 		}
 
 		public String toString() {
 			return ;
 		}
 	}
 
 	// package constructor, only called by Fields
 	ChapterField(OdfElement odfElement) {
 		TextSpanElement spanElement = ((OdfFileDomodfElement.getOwnerDocument()).newOdfElement(TextSpanElement.class);
 		odfElement.appendChild(spanElement);
 		 = spanElement.newTextChapterElement(null, 1);
 	}

Specifies the information that a chapter field should display.

Parameters:
type the display type which is predefined in DisplayType.
 
 	public void setDisplayPage(DisplayType type) {
 	}

Specifies the outline level to be displayed.

Parameters:
level the outline level to be displayed.
 
 	public void setOutlineLevel(int level) {
 	}

Return an instance of TextChapterElement which represents this feature.

Returns:
an instance of TextChapterElement
	}
	public FieldType getFieldType() {
	}
New to GrepCode? Check out our FAQ X