本文整理匯總了Java中org.openide.windows.TopComponentGroup.close方法的典型用法代碼示例。如果您正苦於以下問題:Java TopComponentGroup.close方法的具體用法?Java TopComponentGroup.close怎麽用?Java TopComponentGroup.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.windows.TopComponentGroup
的用法示例。
在下文中一共展示了TopComponentGroup.close方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: beforeSave
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
@Override
public void beforeSave(WindowSystemEvent event) {
// Close the group before window system saves its state (during IDE shutdown)
TopComponentGroup group = getCssStylesTCGroup();
if (group != null) {
group.close();
}
}
示例2: openCloseWindowGroup
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private void openCloseWindowGroup() {
final Project[] projects = OpenProjects.getDefault().getOpenProjects();
Runnable r = new Runnable() {
@Override
public void run() {
TopComponentGroup projectsGroup = WindowManager.getDefault().findTopComponentGroup("OpenedProjects"); //NOI18N
if( null == projectsGroup )
Logger.getLogger(OpenProjectsListener.class.getName()).log( Level.FINE, "OpenedProjects TopComponent Group not found." );
TopComponentGroup taskListGroup = WindowManager.getDefault().findTopComponentGroup("TaskList"); //NOI18N
if( null == taskListGroup )
Logger.getLogger(OpenProjectsListener.class.getName()).log( Level.FINE, "TaskList TopComponent Group not found." );
boolean show = projects.length > 0;
if( show ) {
if( null != projectsGroup )
projectsGroup.open();
if( null != taskListGroup && supportsTaskList(projects) )
taskListGroup.open();
} else {
if( null != projectsGroup )
projectsGroup.close();
if( null != taskListGroup )
taskListGroup.close();
}
}
};
if( SwingUtilities.isEventDispatchThread() )
r.run();
else
SwingUtilities.invokeLater(r);
}
示例3: detachTopComponentsListener
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private static void detachTopComponentsListener() {
if (topcompsListener != null) {
TopComponent.getRegistry()
.removePropertyChangeListener(topcompsListener);
topcompsListener = null;
TopComponentGroup group = WindowManager.getDefault()
.findTopComponentGroup("form"); // NOI18N
if (group != null)
group.close();
}
}
示例4: checkFormGroupVisibility
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
static void checkFormGroupVisibility() {
// when active TopComponent changes, check if we should open or close
// the form editor group of windows (Inspector, Palette, Properties)
WindowManager wm = WindowManager.getDefault();
final TopComponentGroup group = wm.findTopComponentGroup("form"); // NOI18N
if (group == null)
return; // group not found (should not happen)
boolean designerSelected = false;
Iterator it = wm.getModes().iterator();
while (it.hasNext()) {
Mode mode = (Mode) it.next();
TopComponent selected = mode.getSelectedTopComponent();
if (getSelectedElementType(selected) == FORM_ELEMENT_INDEX) {
designerSelected = true;
break;
}
}
if (designerSelected && !Boolean.TRUE.equals(groupVisible)) {
// Bug 116008: calling group.open() first time may cause hiding the
// FormDesigner (some winsys multiview initialization mess), calling
// this method again and hiding the group. By setting the groupVisible
// to false we make the re-entrant call effectively do nothing.
groupVisible = Boolean.FALSE;
group.open();
groupVisible = Boolean.TRUE;
final TopComponentGroup paletteGroup = wm.findTopComponentGroup( "commonpalette" ); // NOI18N
if( null != paletteGroup ) {
paletteGroup.open();
}
}
else if (!designerSelected && !Boolean.FALSE.equals(groupVisible)) {
group.close();
groupVisible = Boolean.FALSE;
}
}
示例5: updateGroupVisibility
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private void updateGroupVisibility() {
WindowManager wm = WindowManager.getDefault();
final TopComponentGroup group = wm.findTopComponentGroup("ireport_jrctx"); // NOI18N
if (group == null) {
return; // group not found (should not happen)
}
//
boolean isVisualViewSelected = false;
Iterator it = wm.getModes().iterator();
while (it.hasNext()) {
Mode mode = (Mode) it.next();
TopComponent selected = mode.getSelectedTopComponent();
if (selected != null) {
MultiViewHandler mvh = MultiViews.findMultiViewHandler(selected);
if (mvh != null) {
MultiViewPerspective mvp = mvh.getSelectedPerspective();
if (mvp != null) {
String id = mvp.preferredID();
if (PREFERRED_ID.equals(id)) {
isVisualViewSelected = true;
break;
}
}
}
}
}
//
if (isVisualViewSelected && !Boolean.TRUE.equals(groupVisible)) {
group.open();
} else if (!isVisualViewSelected && !Boolean.FALSE.equals(groupVisible)) {
group.close();
}
//
groupVisible = isVisualViewSelected ? Boolean.TRUE : Boolean.FALSE;
}
示例6: updateGroupVisibility
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private void updateGroupVisibility() {
WindowManager wm = WindowManager.getDefault();
final TopComponentGroup group = wm.findTopComponentGroup("ireport_jrctx"); // NOI18N
if (group == null) {
return; // group not found (should not happen)
}
//
boolean isVisualViewSelected = false;
Iterator it = wm.getModes().iterator();
while (it.hasNext()) {
Mode mode = (Mode) it.next();
TopComponent selected = mode.getSelectedTopComponent();
if (selected != null) {
MultiViewHandler mvh = MultiViews.findMultiViewHandler(selected);
if (mvh != null) {
MultiViewPerspective mvp = mvh.getSelectedPerspective();
if (mvp != null) {
String id = mvp.preferredID();
if (JRCTXVisualView.PREFERRED_ID.equals(id)) {
isVisualViewSelected = true;
break;
}
}
}
}
}
//
if (isVisualViewSelected && !Boolean.TRUE.equals(groupVisible)) {
group.open();
} else if (!isVisualViewSelected && !Boolean.FALSE.equals(groupVisible)) {
group.close();
}
//
groupVisible = isVisualViewSelected ? Boolean.TRUE : Boolean.FALSE;
}
示例7: closeAppViewGroup
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private void closeAppViewGroup() {
TopComponentGroup group = getAppViewGroup();
if (group == null) {
//System.out.println("AppViewGroup not found");
return;
}
group.close();
}
示例8: updateGroupVisibility
import org.openide.windows.TopComponentGroup; //導入方法依賴的package包/類
private void updateGroupVisibility() {
WindowManager wm = WindowManager.getDefault();
final TopComponentGroup group = wm.findTopComponentGroup("ireport"); // NOI18N
if (group == null) {
return; // group not found (should not happen)
}
//
boolean isVisualViewSelected = false;
Iterator it = wm.getModes().iterator();
while (it.hasNext()) {
Mode mode = (Mode) it.next();
TopComponent selected = mode.getSelectedTopComponent();
if (selected != null) {
MultiViewHandler mvh = MultiViews.findMultiViewHandler(selected);
if (mvh != null) {
MultiViewPerspective mvp = mvh.getSelectedPerspective();
if (mvp != null) {
String id = mvp.preferredID();
if (JrxmlVisualView.PREFERRED_ID.equals(id)) {
isVisualViewSelected = true;
break;
}
}
}
}
}
//
if (isVisualViewSelected && !Boolean.TRUE.equals(groupVisible)) {
group.open();
final TopComponent props = wm.findTopComponent("properties");
if (props != null && props.isVisible())
{
try {
props.getClass().getMethod("setNodes", new Class[]{(new Node[0]).getClass()}).invoke(props, new Object[]{getExplorerManager().getSelectedNodes()});
} catch (Exception ex) {
ex.printStackTrace();
}
}
} else if (!isVisualViewSelected && !Boolean.FALSE.equals(groupVisible)) {
group.close();
}
//
groupVisible = isVisualViewSelected ? Boolean.TRUE : Boolean.FALSE;
}