| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||||||
| ObjectActions |
|
| 0.0;0 |
| 1 | /* |
|
| 2 | * Created on Dec 11, 2004 |
|
| 3 | * |
|
| 4 | * Copyright 2004 Chris Nelson |
|
| 5 | * |
|
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 7 | * you may not use this file except in compliance with the License. |
|
| 8 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
|
| 9 | * Unless required by applicable law or agreed to in writing, |
|
| 10 | * software distributed under the License is distributed on an "AS IS" BASIS, |
|
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 12 | * See the License for the specific language governing permissions and limitations under the License. |
|
| 13 | */ |
|
| 14 | package org.trails.component; |
|
| 15 | ||
| 16 | import org.trails.descriptor.IMethodDescriptor; |
|
| 17 | import org.trails.page.ModelPage; |
|
| 18 | ||
| 19 | import java.util.ArrayList; |
|
| 20 | import java.util.List; |
|
| 21 | ||
| 22 | 4 | public abstract class ObjectActions extends AbstractObjectRenderComponent |
| 23 | { |
|
| 24 | ||
| 25 | public List<IMethodDescriptor> getMethodDescriptors() |
|
| 26 | { |
|
| 27 | 0 | List<IMethodDescriptor> displayingPropertyDescriptors = new ArrayList<IMethodDescriptor>(); |
| 28 | 0 | for (IMethodDescriptor methodDescriptor : getClassDescriptor().getMethodDescriptors()) |
| 29 | { |
|
| 30 | 0 | if (!methodDescriptor.isHidden()) |
| 31 | { |
|
| 32 | 0 | displayingPropertyDescriptors.add(methodDescriptor); |
| 33 | } |
|
| 34 | } |
|
| 35 | 0 | return displayingPropertyDescriptors; |
| 36 | } |
|
| 37 | ||
| 38 | public boolean isShowRemoveButton() |
|
| 39 | { |
|
| 40 | 16 | ModelPage page = (ModelPage) getPage(); |
| 41 | 16 | return page != null && page.getClassDescriptor().isAllowRemove() && !page.isModelNew(); |
| 42 | } |
|
| 43 | ||
| 44 | } |