2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 import com
.sun
.star
.inspection
.PropertyCategoryDescriptor
;
22 import com
.sun
.star
.inspection
.XObjectInspectorModel
;
25 * This is an implementation of <CODE>ObjectInspectorModel</CODE>.
26 * @see com.sun.star.inspection.XObjectInspectorModel
28 public class ObjectInspectorModelImpl
implements XObjectInspectorModel
{
31 * class variable which contains the implementations of
32 * <CODE>PropertyCategoryDescriptor</CODE>
33 * @see com.sun.star.inspection.PropertyCategoryDescriptor
35 PropertyCategoryDescriptor
[] m_Categories
;
38 * class variable which contains the count of implementations of
39 * <CODE>PropertyCategoryDescriptor</CODE>
44 * Creates a new instance of ObjectInspectorModelImpl
45 * For every count given in parameter <CODE>count</CODE> an
46 * <CODE>PropertyCategoryDescriptor</CODE> was created an filled with valuable content.
47 * @param count count of <CODE>PropertyCategoryDescriptor</CODE> to create
49 public ObjectInspectorModelImpl(int count
) {
51 m_Categories
= new PropertyCategoryDescriptor
[m_count
];
54 for (int n
=0; n
< m_count
; n
++ ){
56 m_Categories
[n
] = new PropertyCategoryDescriptor();
59 inCat
=(CategoryMem
== category
)?
++inCat
: 1;
60 CategoryMem
= category
;
62 //System.out.println("Category" + category + "Number" + inCat);
63 m_Categories
[n
].ProgrammaticName
= "Category" + category
;
64 m_Categories
[n
].UIName
= "Category" + category
+ "Number" + inCat
;
65 m_Categories
[n
].HelpURL
= "h:" + n
;
70 * returns the catrgories
71 * @return returns the catrgories
73 public PropertyCategoryDescriptor
[] describeCategories() {
78 * returns currently nothing
81 public Object
[] getHandlerFactories() {
85 /** determines whether the object inspector should have a help section
88 public boolean getHasHelpSection() {
92 /** returns minimum number of lines in the help text section.
95 public int getMinHelpTextLines() {
99 /** returns maximum number of lines in the help text section.
102 public int getMaxHelpTextLines() {
106 /** returns whether or not the inspector's UI should be read-only
108 public boolean getIsReadOnly() {
112 /** sets the inspector's read-only state
114 public void setIsReadOnly( boolean _IsReadOnly
) {
115 // not supported, and not used so far in our test cases
119 * retrieves an index in a global property ordering, for a given property name
120 * @param UIName the property whose global order index should be retrieved
121 * @throws com.sun.star.beans.UnknownPropertyException if the given property is unknown
122 * @return the global order index of PropertyName
124 public int getPropertyOrderIndex(String UIName
) {
126 for (int n
=0; n
< m_Categories
.length
; n
++){
127 if (m_Categories
[n
].UIName
.equals(UIName
)){