cleanup
[idea/community.git] / platform / platform-api / src / com / intellij / ui / content / Content.java
1 /*
2  * Copyright 2000-2009 JetBrains s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.intellij.ui.content;
17
18 import com.intellij.openapi.Disposable;
19 import com.intellij.openapi.actionSystem.ActionGroup;
20 import com.intellij.openapi.ui.ComponentContainer;
21 import com.intellij.openapi.util.Computable;
22 import com.intellij.openapi.util.UserDataHolder;
23 import org.jetbrains.annotations.NonNls;
24 import org.jetbrains.annotations.Nullable;
25
26 import javax.swing.*;
27 import java.beans.PropertyChangeListener;
28
29 public interface Content extends UserDataHolder, ComponentContainer {
30   @NonNls
31   String PROP_DISPLAY_NAME = "displayName";
32   @NonNls
33   String PROP_ICON = "icon";
34   String PROP_ACTIONS = "actions";
35   @NonNls String PROP_DESCRIPTION = "description";
36   @NonNls 
37   String PROP_COMPONENT = "component";
38
39   String PROP_ALERT = "alerting";
40
41   void setComponent(JComponent component);
42
43   void setPreferredFocusableComponent(JComponent component);
44
45   void setPreferredFocusedComponent(Computable<JComponent> computable);
46
47   void setIcon(Icon icon);
48
49   Icon getIcon();
50
51   void setDisplayName(String displayName);
52
53   String getDisplayName();
54
55   void setTabName(String tabName);
56
57   String getTabName();
58
59   void setToolwindowTitle(String toolwindowTitle);
60
61   String getToolwindowTitle();
62
63   Disposable getDisposer();
64
65   /**
66    * @param disposer a Disposable object whoes dispose() method will be invoked upon this content release.
67    */
68   void setDisposer(Disposable disposer);
69
70   String getDescription();
71
72   void setDescription(String description);
73
74   void addPropertyChangeListener(PropertyChangeListener l);
75
76   void removePropertyChangeListener(PropertyChangeListener l);
77
78   ContentManager getManager();
79
80   boolean isSelected();
81
82   void release();
83
84   boolean isValid();
85   boolean isPinned();
86
87   void setPinned(boolean locked);
88   boolean isPinnable();
89
90   boolean isCloseable();
91   void setCloseable(boolean closeable);
92
93   void setActions(ActionGroup actions, String place, @Nullable JComponent contextComponent);
94   void setSearchComponent(@Nullable JComponent comp);
95
96   ActionGroup getActions();
97   @Nullable JComponent getSearchComponent();
98   String getPlace();
99   JComponent getActionsContextComponent();
100
101   void setAlertIcon(@Nullable AlertIcon icon);
102   @Nullable AlertIcon getAlertIcon();
103
104   void fireAlert();
105   
106 }