本文整理汇总了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();
}