KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > properties > tabbed > ISectionDescriptor


1 /*******************************************************************************
2  * Copyright (c) 2001, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.views.properties.tabbed;
12
13 import java.util.List JavaDoc;
14
15 import org.eclipse.jface.viewers.IFilter;
16 import org.eclipse.jface.viewers.ISelection;
17 import org.eclipse.ui.IWorkbenchPart;
18
19 /**
20  * Represents a section descriptor on the tabbed property sections extensions.
21  *
22  * @author Anthony Hunter
23  */

24 public interface ISectionDescriptor {
25
26     /**
27      * If enabledFor is not specified in the descriptor, enable for any selection.
28      */

29     public final int ENABLES_FOR_ANY = -1;
30
31     /**
32      * Get the unique identifier for the section.
33      *
34      * @return the unique identifier for the section.
35      */

36     public String JavaDoc getId();
37
38     /**
39      * Get the section filter instance for this section. Return null if no
40      * filter for this section.
41      *
42      * @return the section filter instance.
43      */

44     public IFilter getFilter();
45
46     /**
47      * Get the valid input types for this section.
48      *
49      * @return the valid input types for this section.
50      */

51     public List JavaDoc getInputTypes();
52
53     /**
54      * Get the class that implements this section.
55      *
56      * @return the class that implements this section.
57      */

58     public ISection getSectionClass();
59
60     /**
61      * Get the target tab where this section will appear.
62      *
63      * @return the target tab where this section will appear.
64      */

65     public String JavaDoc getTargetTab();
66
67     /**
68      * Get the value for section enablement which is a precise number of
69      * items selected. For example: enablesFor="1" enables the section only when
70      * one item is selected. If not specified, enable for any selection and return ENABLES_FOR_ANY.
71      *
72      * @return the value for section enablement.
73      */

74     public int getEnablesFor();
75         
76     /**
77      * Determines if this section applies to the selection.
78      * @param part the current workbench part.
79      * @param selection the selection.
80      * @return <code>true</code> if this section applies to the current
81      * selection.
82      */

83     public boolean appliesTo(IWorkbenchPart part, ISelection selection);
84
85     /**
86      * Get the section identifier below which this section is displayed. <code>"top"</code>
87      * is returned if this section is the top most section or if there is one
88      * section in the tab.
89      *
90      * @return the section identifier.
91      */

92     public String JavaDoc getAfterSection();
93 }
94
Popular Tags