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


Java TopComponent.requestVisible方法代碼示例

本文整理匯總了Java中org.openide.windows.TopComponent.requestVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java TopComponent.requestVisible方法的具體用法?Java TopComponent.requestVisible怎麽用?Java TopComponent.requestVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.windows.TopComponent的用法示例。


在下文中一共展示了TopComponent.requestVisible方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: userTriggeredAutoSlideIn

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
/** Request for automatic slide in from gesture recognizer */
@Override
public boolean userTriggeredAutoSlideIn(Component sourceButton) {
    int index = getButtonIndex(sourceButton);
    if (index < 0) {
        return false;
    }
    SlidingButton button = (SlidingButton) buttons.get(index);
    button.setBlinking(false);
    TopComponent tc = (TopComponent)dataModel.getTab(index).getComponent();
    if (tc == null) {
        return false;
    }
    tc.requestVisible();
    return true;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:SlideBar.java

示例3: doCheck

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
private void doCheck(TopComponent mvc, InstanceContent ic) {
       assertNotNull("MultiViewComponent cloned", mvc);
       MultiViewHandler handler = MultiViews.findMultiViewHandler(mvc);
       assertNotNull("Handler found", handler);
       MultiViewPerspective[] arr = handler.getPerspectives();
       assertEquals("Two perspetives found", 2, arr.length);
       assertEquals("Contextual", arr[0].getDisplayName());
assertEquals("Contextual", arr[1].getDisplayName());
MultiViewDescription description = Accessor.DEFAULT.extractDescription(arr[0]);
assertTrue(description instanceof ContextAwareDescription);
       assertFalse("First one is not for split", ((ContextAwareDescription)description).isSplitDescription());
description = Accessor.DEFAULT.extractDescription(arr[1]);
assertTrue(description instanceof ContextAwareDescription);
       assertTrue("Second one is for split", ((ContextAwareDescription)description).isSplitDescription());

       assertPersistence("Always", TopComponent.PERSISTENCE_ALWAYS, mvc);
       
       mvc.open();
       mvc.requestActive();
       mvc.requestVisible();
       
       handler.requestActive(arr[0]);
       assertNull("No integer now", mvc.getLookup().lookup(Integer.class));
       ic.add(1);
       assertEquals("1 now", Integer.valueOf(1), mvc.getLookup().lookup(Integer.class));

((MultiViewCloneableTopComponent)mvc).splitComponent(JSplitPane.HORIZONTAL_SPLIT, -1);
handler.requestActive(arr[0]);
ic.remove(1);
       assertNull("No integer now", mvc.getLookup().lookup(Integer.class));
       ic.add(2);
       assertEquals("2 now", Integer.valueOf(2), mvc.getLookup().lookup(Integer.class));
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:MultiViewProcessorTest.java

示例4: testMultiViewsContextCreate

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public void testMultiViewsContextCreate() {
       InstanceContent ic = new InstanceContent();
       Lookup lookup = new AbstractLookup(ic);
       
       TopComponent mvc = MultiViews.createMultiView("text/context", new LP(lookup));
       assertNotNull("MultiViewComponent created", mvc);
       MultiViewHandler handler = MultiViews.findMultiViewHandler(mvc);
       assertNotNull("Handler found", handler);
       MultiViewPerspective[] arr = handler.getPerspectives();
       assertEquals("Two perspetives found", 2, arr.length);
       assertEquals("Contextual", arr[0].getDisplayName());
assertEquals("Contextual", arr[1].getDisplayName());
MultiViewDescription description = Accessor.DEFAULT.extractDescription(arr[0]);
assertTrue(description instanceof ContextAwareDescription);
       assertFalse("First one is not for split", ((ContextAwareDescription)description).isSplitDescription());
description = Accessor.DEFAULT.extractDescription(arr[1]);
assertTrue(description instanceof ContextAwareDescription);
       assertTrue("Second one is for split", ((ContextAwareDescription)description).isSplitDescription());
       
       mvc.open();
       mvc.requestActive();
       mvc.requestVisible();
       
       handler.requestActive(arr[0]);
       assertNull("No integer now", mvc.getLookup().lookup(Integer.class));
       ic.add(1);
       assertEquals("1 now", Integer.valueOf(1), mvc.getLookup().lookup(Integer.class));

((MultiViewTopComponent)mvc).splitComponent(JSplitPane.HORIZONTAL_SPLIT, -1);
ic.remove(1);
handler.requestActive(arr[1]);
       assertNull("No integer now", mvc.getLookup().lookup(Integer.class));
       ic.add(2);
       assertEquals("2 now", Integer.valueOf(2), mvc.getLookup().lookup(Integer.class));
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:36,代碼來源:MultiViewProcessorTest.java

示例5: assertTextDocuments

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public static void assertTextDocuments() throws Exception {
    closeTopComponents();
    Thread.sleep(2000);
            TopComponent tc = new TopComponent();
            tc.setLayout(new FlowLayout());
            tc.add(new JTextArea());
            tc.open();
            tc.requestVisible();
            tc.requestActive();
            String jVMversion = System.getProperty("java.specification.version");
            System.out.println("Java.specification.version="+jVMversion);
            if (!("1.8".equals(jVMversion))) {
                try {
                    System.out.println("Cleaning well known static fields");
                    cleanWellKnownStaticFields();
                } catch (Exception ex) {
                    throw new IllegalStateException(ex);
                }
            }
            System.setProperty("assertgc.paths", "0");
            try {
                Thread.sleep(4000);
            } catch (InterruptedException exc) {
                Exceptions.printStackTrace(exc);
            }
            try {
                Log.assertInstances("Are all documents GCed?", "TextDocument");
            } catch (AssertionFailedError afe) {
                throw afe;
            } finally {
                dumpHeap(null);
            }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:34,代碼來源:PerfWatchProjects.java


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