bump product version to 4.2.0.1
[LibreOffice.git] / qadevOOo / runner / helper / ObjectInspectorModelImpl.java
blob3626a0dabeeeda5c604bc13a8d0d26139cf7d75a
1 /*
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 .
19 package helper;
21 import com.sun.star.inspection.PropertyCategoryDescriptor;
22 import com.sun.star.inspection.XObjectInspectorModel;
24 /**
25 * This is an implementation of <CODE>ObjectInspectorModel</CODE>.
26 * @see com.sun.star.inspection.XObjectInspectorModel
28 public class ObjectInspectorModelImpl implements XObjectInspectorModel{
30 /**
31 * class variable which contains the implementations of
32 * <CODE>PropertyCategoryDescriptor</CODE>
33 * @see com.sun.star.inspection.PropertyCategoryDescriptor
35 PropertyCategoryDescriptor[] m_Categories;
37 /**
38 * class variable which contains the count of implementations of
39 * <CODE>PropertyCategoryDescriptor</CODE>
41 int m_count;
43 /**
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) {
50 m_count = count;
51 m_Categories = new PropertyCategoryDescriptor[m_count];
52 int CategoryMem = 0;
53 int inCat = 0;
54 for (int n=0; n < m_count; n++ ){
56 m_Categories[n] = new PropertyCategoryDescriptor();
58 int category = n / 2;
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;
69 /**
70 * returns the catrgories
71 * @return returns the catrgories
73 public PropertyCategoryDescriptor[] describeCategories() {
74 return m_Categories;
77 /**
78 * returns currently nothing
79 * @return nothing
81 public Object[] getHandlerFactories() {
82 return null;
85 /** determines whether the object inspector should have a help section
86 @return false
88 public boolean getHasHelpSection() {
89 return false;
92 /** returns minimum number of lines in the help text section.
93 @return 3
95 public int getMinHelpTextLines() {
96 return 3;
99 /** returns maximum number of lines in the help text section.
100 @return 8
102 public int getMaxHelpTextLines() {
103 return 8;
106 /** returns whether or not the inspector's UI should be read-only
108 public boolean getIsReadOnly() {
109 return false;
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) {
125 int index = 0;
126 for (int n=0; n < m_Categories.length; n++){
127 if (m_Categories[n].UIName.equals(UIName)){
128 index = n;
129 break;
132 return index;