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


Java TopComponent.requestActive方法代碼示例

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


在下文中一共展示了TopComponent.requestActive方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: userClickedSlidingButton

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
/** Triggers slide operation by changing selected index */
@Override
public void userClickedSlidingButton(Component clickedButton) {
    int index = getButtonIndex(clickedButton);
    SlidingButton button = (SlidingButton) buttons.get(index);
    button.setBlinking(false);
    
    if (index != selModel.getSelectedIndex() || !isActive()) {
        TopComponent tc = (TopComponent)dataModel.getTab(index).getComponent();
        if (tc != null) {
            tc.requestActive();
        }
        button.setSelected( true );
    } else {
        selModel.setSelectedIndex(-1);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:SlideBar.java

示例2: actionPerformed

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
/** Opens component palette. */
public void actionPerformed(ActionEvent evt) {
    // show ComponentPalette
    TopComponent palette = WindowManager.getDefault().findTopComponent("CommonPalette"); // NOI18N
    if( null == palette ) {
        Logger.getLogger( getClass().getName() ).log( Level.INFO, "Cannot find CommonPalette component." ); // NOI18N
            
        return;
    }
    Utils.setOpenedByUser( palette, true );
    palette.open();
    palette.requestActive();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:ShowPaletteAction.java

示例3: splitWindow

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
static void splitWindow(TopComponent tc, int orientation, int splitLocation) {
if (tc instanceof Splitable) {
    TopComponent split = ((Splitable) tc).splitComponent(orientation, splitLocation);
    split.open();
    split.requestActive();
           split.invalidate();
           split.revalidate();
           split.repaint();
           split.requestFocusInWindow();
}
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:SplitAction.java

示例4: clearSplit

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
static void clearSplit(TopComponent tc, int elementToActivate) {
if (tc instanceof Splitable) {
    TopComponent original = ((Splitable) tc).clearSplit(elementToActivate);
    original.open();
    original.requestActive();
           original.invalidate();
           original.revalidate();
           original.repaint();
           original.requestFocusInWindow();
}
   }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:SplitAction.java

示例5: handleActivation

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
private void handleActivation(MouseEvent evt) {
    Object obj = evt.getSource();
    if (!(obj instanceof Component)) {
        return;
    }
    Component comp = (Component) obj;
    
    while (comp != null && !(comp instanceof ModeComponent)) {
        if (comp instanceof JComponent) {
            JComponent c = (JComponent)comp;
            // don't activate if requested
            if (Boolean.TRUE.equals(c.getClientProperty("dontActivate"))) { //NOI18N
                return;
            }
        }
        if (comp instanceof TopComponent) {
            TopComponent tc = (TopComponent)comp;
            // special way of activation for topcomponents in sliding mode
            if (Boolean.TRUE.equals(tc.getClientProperty("isSliding"))) { //NOI18N
                tc.requestActive();
                return;
            }
        }
        comp = comp.getParent();
    }

    if (comp instanceof ModeComponent) {
        ModeComponent modeComp = (ModeComponent)comp;
        // don't activate sliding views when user clicked edge bar
        if (modeComp.getKind() != Constants.MODE_KIND_SLIDING) {
            ModeView modeView = modeComp.getModeView();
            modeView.getController().userActivatedModeView(modeView);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:36,代碼來源:TabbedHandler.java

示例6: returnFocus

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
private void returnFocus (boolean force) {
    displayer.setVisible(false);
    if (caller != null) {
        TopComponent tc = caller.get();
        if (tc != null) {
            tc.requestActive();
            tc.requestFocus();
            return;
        }
    }
    if (force) {
        KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:15,代碼來源:AbstractQuickSearchComboBar.java

示例7: openComponent

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
static TopComponent openComponent (String viewName, boolean activate) {
    TopComponent view = WindowManager.getDefault().findTopComponent(viewName);
    if (view == null) {
        throw new IllegalArgumentException(viewName);
    }
    view.open();
    if (activate) {
        view.requestActive();
    }
    return view;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:ViewActions.java

示例8: action

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public synchronized void action(ActionEvent e) {
    if (serverDef.getServerFlag().getFlag() != null) {
        TopComponent map = WindowManager.getDefault().findTopComponent(uid);
        if (map == null) {
            map = new PureMapTopComponent(serverDef);
            uid = WindowManager.getDefault().findTopComponentID(map);
        }
        map.open();
        map.requestActive();
    }
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:13,代碼來源:UnrealServerNode.java

示例9: run

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public Void run() {
    assertTrue("Is EDT", EventQueue.isDispatchThread());
    TopComponent tc =new TopComponent();
    tc.open();
    tc.requestActive();
    return null;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:InitializeInAWTTest.java

示例10: actionPerformed

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public void actionPerformed (ActionEvent evt) {
    Component focusOwner = FocusManager.getCurrentManager().getFocusOwner();
    // move focus away only from navigator AWT children,
    // but not combo box to preserve its ESC functionality
    if (lastActivatedRef == null ||
        focusOwner == null ||
        !SwingUtilities.isDescendingFrom(focusOwner, navigatorTC.getTopComponent()) ||
        focusOwner instanceof JComboBox) {
        return;
    }
    TopComponent prevFocusedTc = lastActivatedRef.get();
    if (prevFocusedTc != null) {
        prevFocusedTc.requestActive();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:NavigatorController.java

示例11: put

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public Object put(String key, Object value) {
    if ("requestActive".equals(key)) {
        TopComponent tc = (TopComponent)value;
        tc.requestActive();
        return null;
    }
    
    throw new UnsupportedOperationException("Not supported yet.");
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:Calls.java

示例12: onMouseClick

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
/**
 * Invoked when the user clicks the icon.
 */
protected void onMouseClick() {
    TopComponent tc = WindowManager.getDefault().findTopComponent("NotificationCenterTopComponent");
    tc.open();
    tc.requestActive();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:FlashingIcon.java

示例13: actionPerformed

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent evt) {
    TopComponent win = FilterTopComponent.findInstance();
    win.open();
    win.requestActive();
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:7,代碼來源:FilterAction.java

示例14: showResults

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public void showResults(URL url) {
    TopComponent topComponent = getReport(true);
    topComponent.open();
    topComponent.requestActive();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:StopwatchProfilingPoint.java

示例15: actionPerformed

import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent evt) {
    TopComponent win = BytecodeViewTopComponent.findInstance();
    win.open();
    win.requestActive();
}
 
開發者ID:arodchen,項目名稱:MaxSim,代碼行數:7,代碼來源:BytecodeViewAction.java


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