本文整理汇总了Java中org.openide.windows.TopComponent.isShowing方法的典型用法代码示例。如果您正苦于以下问题:Java TopComponent.isShowing方法的具体用法?Java TopComponent.isShowing怎么用?Java TopComponent.isShowing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openide.windows.TopComponent
的用法示例。
在下文中一共展示了TopComponent.isShowing方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void actionPerformed(ActionEvent e) {
if (refreshButton == e.getSource()) {
final JTextComponent lastFocusedComponent = EditorRegistry.lastFocusedComponent();
if (lastFocusedComponent != null) {
final JavaSource js = JavaSource.forDocument(Utilities.getDocument(lastFocusedComponent));
if (js != null) {
setContext(js, lastFocusedComponent);
}
}
} else if (jdocButton == e.getSource()) {
final TopComponent win = JavadocTopComponent.findInstance();
if (win != null && !win.isShowing()) {
win.open();
win.requestVisible();
jdocTask.schedule(NOW);
}
} else if (historyCombo == e.getSource()) {
refresh();
} else if (viewTypeCombo == e.getSource()) {
refresh();
}
}
示例2: isPaletteMaximized
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private boolean isPaletteMaximized() {
boolean isMaximized = true;
TopComponent.Registry registry = TopComponent.getRegistry();
Set openedTcs = registry.getOpened();
for( Iterator i=openedTcs.iterator(); i.hasNext(); ) {
TopComponent tc = (TopComponent)i.next();
if( tc.isShowing() && !(tc instanceof PaletteTopComponent) ) {
//other window(s) than the Palette are showing
isMaximized = false;
break;
}
}
return isMaximized;
}
示例3: findShowingTCs
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private ArrayList<TopComponent> findShowingTCs() {
ArrayList<TopComponent> res = new ArrayList<TopComponent>( 3 );
for( TopComponent tc : TopComponent.getRegistry().getOpened() ) {
if( tc.isShowing() )
res.add( tc );
}
return res;
}
示例4: isHeavyWeightShowing
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private boolean isHeavyWeightShowing() {
for( TopComponent tc : TopComponent.getRegistry().getOpened() ) {
if( !tc.isShowing() )
continue;
if( containsHeavyWeightChild( tc ) )
return true;
}
return false;
}
示例5: getFileFromTopComponent
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private FileObject getFileFromTopComponent( final TopComponent tc ) {
if( null == tc || !tc.isShowing() )
return null;
if( WindowManager.getDefault().isOpenedEditorTopComponent( tc ) ) {
DataObject dob = tc.getLookup().lookup( DataObject.class );
if( null != dob ) {
return dob.getPrimaryFile();
}
}
return null;
}
示例6: getPaletteFromTopComponent
import org.openide.windows.TopComponent; //导入方法依赖的package包/类
PaletteController getPaletteFromTopComponent( TopComponent tc, boolean mustBeShowing, boolean isOpened ) {
if( null == tc || (!tc.isShowing() && mustBeShowing) )
return null;
PaletteController pc = (PaletteController)tc.getLookup().lookup( PaletteController.class );
//#231997 - TopComponent.getSubComponents() can be called from EDT only
//The only drawback of commenting out the code below is that a split view of
//a form designer showing source and design hides the palette window
//when the source split is the active one and some other TopComponent is activated
// if (pc == null && isOpened) {
// TopComponent.SubComponent[] subComponents = tc.getSubComponents();
// for (int i = 0; i < subComponents.length; i++) {
// TopComponent.SubComponent subComponent = subComponents[i];
// Lookup subComponentLookup = subComponent.getLookup();
// if (subComponentLookup != null) {
// pc = (PaletteController) subComponentLookup.lookup(PaletteController.class);
// if (pc != null && (subComponent.isActive() || subComponent.isShowing())) {
// break;
// }
// }
// }
// }
if( null == pc && isOpened ) {
//check if there's any palette assigned to TopComponent's mime type
Node[] activeNodes = tc.getActivatedNodes();
if( null != activeNodes && activeNodes.length > 0 ) {
DataObject dob = activeNodes[0].getLookup().lookup( DataObject.class );
if( null != dob ) {
while( dob instanceof DataShadow ) {
dob = ((DataShadow)dob).getOriginal();
}
FileObject fo = dob.getPrimaryFile();
if( !fo.isVirtual() ) {
String mimeType = fo.getMIMEType();
pc = getPaletteFromMimeType( mimeType );
}
}
}
}
return pc;
}