Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved. Copyright 2009, 2010 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.presentation;
 
 
Notes represents the presentation notes feature of the ODF document. Notes provides methods to creates notes, add content, add list, etc.
 
 public class Notes extends Component implements ListContainer {
 
This is a tool class which supplies all of the notes creation detail.

The end user isn't allowed to create it directly, otherwise an IllegalStateException will be thrown.

Since:
0.3.5
 
 	public static class NotesBuilder {
 
NotesBuilder constructor. This constructor should only be use in owner PresentationDocument constructor. The end user isn't allowed to call it directly, otherwise an IllegalStateException will be thrown.

Parameters:
doc the owner PresentationDocument.
Throws:
java.lang.IllegalStateException if new NotesBuilder out of owner PresentationDocument constructor, this exception will be thrown.
 
 			if (doc.getNotesBuilder() != null) {
 				throw new IllegalStateException(
 						"NotesBuilder only can be created in owner PresentationDocument constructor.");
 			}
 		}

Get a presentation notes page instance by an instance of PresentationNotesElement.

Parameters:
noteElement an instance of PresentationNotesElement
Returns:
an instance of Notes that can represent PresentationNotesElement
 
 		public synchronized Notes getNotesInstance(PresentationNotesElement noteElement) {
 			if (.containsKey(noteElement))
 				return .get(noteElement);
 			else {
				Notes newNotes = new Notes(noteElement);
				.put(noteElementnewNotes);
				return newNotes;
			}
		}
	}
	private Notes(PresentationNotesElement noteElement) {
		 = noteElement;
	}

Get a presentation notes page instance by an instance of PresentationNotesElement.

Parameters:
noteElement an instance of PresentationNotesElement
Returns:
an instance of Notes that can represent PresentationNotesElement
	public static Notes getInstance(PresentationNotesElement noteElement) {
		PresentationDocument ownerDocument = (PresentationDocument) ((OdfFileDom) (noteElement.getOwnerDocument()))
		return ownerDocument.getNotesBuilder().getNotesInstance(noteElement);
	}

Return an instance of PresentationNotesElement which represents presentation notes page feature.

Returns:
an instance of PresentationNotesElement
	}

insert some text to the notes page

Parameters:
text the text that need to insert in the notes page
	public void addText(String text) {
		if (frameList.getLength() > 0) {
			DrawFrameElement frame = (DrawFrameElementframeList.item(0);
			NodeList textBoxList = frame.getElementsByTagNameNS(..getUri(), "text-box");
			if (textBoxList.getLength() > 0) {
				DrawTextBoxElement textBox = (DrawTextBoxElementtextBoxList.item(0);
				TextPElement newPara = textBox.newTextPElement();
				newPara.setTextContent(text);
			}
		}
	}
	}
	public List addList() {
	}
	public List addList(ListDecorator decorator) {
		return getListContainerImpl().addList(decorator);
	}
	public void clearList() {
	}
	}
	public boolean removeList(List list) {
	}
		if ( == null) {
		}
	}
	private class ListContainerImpl extends AbstractListContainer {
			DrawFrameElement frame = null;
			DrawTextBoxElement textBox = null;
			if (frameList.getLength() <= 0) {
else {
				frame = (DrawFrameElementframeList.item(frameList.getLength() - 1);
			}
			NodeList textBoxList = frame.getElementsByTagNameNS(..getUri(), "text-box");
			if (textBoxList.getLength() <= 0) {
				textBox = frame.newDrawTextBoxElement();
else {
				textBox = (DrawTextBoxElementtextBoxList.item(textBoxList.getLength() - 1);
			}
			return textBox;
		}
	}
New to GrepCode? Check out our FAQ X