1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************
31 import com
.sun
.star
.inspection
.PropertyCategoryDescriptor
;
32 import com
.sun
.star
.inspection
.XObjectInspectorModel
;
35 * This is an implementation of <CODE>ObjectInspectorModel</CODE>.
36 * @see com.sun.star.inspection.XObjectInspectorModel
38 public class ObjectInspectorModelImpl
implements XObjectInspectorModel
{
41 * class variable which contains the implementations of
42 * <CODE>PropertyCategoryDescriptor</CODE>
43 * @see com.sun.star.inspection.PropertyCategoryDescriptor
45 PropertyCategoryDescriptor
[] m_Categories
;
48 * class variable which contains the count of implementations of
49 * <CODE>PropertyCategoryDescriptor</CODE>
54 * Creates a new instance of ObjectInspectorModelImpl
55 * For every count given in parameter <CODE>count</CODE> an
56 * <CODE>PropertyCategoryDescriptor</CODE> was created an filled with valuable content.
57 * @param count count of <CODE>PropertyCategoryDescriptor</CODE> to create
59 public ObjectInspectorModelImpl(int count
) {
61 m_Categories
= new PropertyCategoryDescriptor
[m_count
];
64 for (int n
=0; n
< m_count
; n
++ ){
66 m_Categories
[n
] = new PropertyCategoryDescriptor();
69 inCat
=(CategoryMem
== category
)?
++inCat
: 1;
70 CategoryMem
= category
;
72 //System.out.println("Category" + category + "Number" + inCat);
73 m_Categories
[n
].ProgrammaticName
= "Category" + category
;
74 m_Categories
[n
].UIName
= "Category" + category
+ "Number" + inCat
;
75 m_Categories
[n
].HelpURL
= "h:" + n
;
80 * returns the catrgories
81 * @return returns the catrgories
83 public PropertyCategoryDescriptor
[] describeCategories() {
88 * returns currently nothing
91 public Object
[] getHandlerFactories() {
95 /** determines whether the object inspector should have a help section
98 public boolean getHasHelpSection() {
102 /** returns minimum number of lines in the help text section.
105 public int getMinHelpTextLines() {
109 /** returns maximum number of lines in the help text section.
112 public int getMaxHelpTextLines() {
116 /** returns whether or not the inspector's UI should be read-only
118 public boolean getIsReadOnly() {
122 /** sets the inspector's read-only state
124 public void setIsReadOnly( boolean _IsReadOnly
) {
125 // not supported, and not used so far in our test cases
129 * retrieves an index in a global property ordering, for a given property name
130 * @param UIName the property whose global order index should be retrieved
131 * @throws com.sun.star.beans.UnknownPropertyException if the given property is unknown
132 * @return the global order index of PropertyName
134 public int getPropertyOrderIndex(String UIName
) {
136 for (int n
=0; n
< m_Categories
.length
; n
++){
137 if (m_Categories
[n
].UIName
.equals(UIName
)){