当前位置: 首页>>代码示例>>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;未经允许,请勿转载。