本文整理匯總了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);
}
}
示例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();
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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.");
}
示例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();
}
示例13: actionPerformed
import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent evt) {
TopComponent win = FilterTopComponent.findInstance();
win.open();
win.requestActive();
}
示例14: showResults
import org.openide.windows.TopComponent; //導入方法依賴的package包/類
public void showResults(URL url) {
TopComponent topComponent = getReport(true);
topComponent.open();
topComponent.requestActive();
}
示例15: actionPerformed
import org.openide.windows.TopComponent; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent evt) {
TopComponent win = BytecodeViewTopComponent.findInstance();
win.open();
win.requestActive();
}