當前位置: 首頁>>代碼示例>>Java>>正文


Java TopComponent.isShowing方法代碼示例

本文整理匯總了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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:HierarchyTopComponent.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:PaletteSwitch.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:PaletteSwitch.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:SlideOperationImpl.java

示例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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:CurrentEditorScanningScope.java

示例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;
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:42,代碼來源:PaletteSwitch.java


注:本文中的org.openide.windows.TopComponent.isShowing方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。