1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ObjectInspectorModelImpl.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************
34 import com
.sun
.star
.inspection
.PropertyCategoryDescriptor
;
35 import com
.sun
.star
.inspection
.XObjectInspectorModel
;
38 * This is an implementation of <CODE>ObjectInspectorModel</CODE>.
39 * @see com.sun.star.inspection.XObjectInspectorModel
41 public class ObjectInspectorModelImpl
implements XObjectInspectorModel
{
44 * class variable which contains the implementations of
45 * <CODE>PropertyCategoryDescriptor</CODE>
46 * @see com.sun.star.inspection.PropertyCategoryDescriptor
48 PropertyCategoryDescriptor
[] m_Categories
;
51 * class variable which contains the count of implementations of
52 * <CODE>PropertyCategoryDescriptor</CODE>
57 * Creates a new instance of ObjectInspectorModelImpl
58 * For every count given in parameter <CODE>count</CODE> an
59 * <CODE>PropertyCategoryDescriptor</CODE> was created an filled with valuable content.
60 * @param count count of <CODE>PropertyCategoryDescriptor</CODE> to create
62 public ObjectInspectorModelImpl(int count
) {
64 m_Categories
= new PropertyCategoryDescriptor
[m_count
];
67 for (int n
=0; n
< m_count
; n
++ ){
69 m_Categories
[n
] = new PropertyCategoryDescriptor();
72 inCat
=(CategoryMem
== category
)?
++inCat
: 1;
73 CategoryMem
= category
;
75 //System.out.println("Category" + category + "Number" + inCat);
76 m_Categories
[n
].ProgrammaticName
= "Category" + category
;
77 m_Categories
[n
].UIName
= "Category" + category
+ "Number" + inCat
;
78 m_Categories
[n
].HelpURL
= "h:" + n
;
83 * returns the catrgories
84 * @return returns the catrgories
86 public PropertyCategoryDescriptor
[] describeCategories() {
91 * returns currently nothing
94 public Object
[] getHandlerFactories() {
98 /** determines whether the object inspector should have a help section
101 public boolean getHasHelpSection() {
105 /** returns minimum number of lines in the help text section.
108 public int getMinHelpTextLines() {
112 /** returns maximum number of lines in the help text section.
115 public int getMaxHelpTextLines() {
119 /** returns whether or not the inspector's UI should be read-only
121 public boolean getIsReadOnly() {
125 /** sets the inspector's read-only state
127 public void setIsReadOnly( boolean _IsReadOnly
) {
128 // not supported, and not used so far in our test cases
132 * retrieves an index in a global property ordering, for a given property name
133 * @param UIName the property whose global order index should be retrieved
134 * @throws com.sun.star.beans.UnknownPropertyException if the given property is unknown
135 * @return the global order index of PropertyName
137 public int getPropertyOrderIndex(String UIName
) {
139 for (int n
=0; n
< m_Categories
.length
; n
++){
140 if (m_Categories
[n
].UIName
.equals(UIName
)){