本文整理了Java中org.eclipse.swt.widgets.Shell.setActive()
方法的一些代码示例,展示了Shell.setActive()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.setActive()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:setActive
[英]If the receiver is visible, moves it to the top of the drawing order for the display on which it was created (so that all other shells on that display, which are not the receiver's children will be drawn behind it) and asks the window manager to make the shell active
[中]如果接收器可见,请将其移动到创建它的显示器的绘图顺序的顶部(以便该显示器上的所有其他壳(不是接收器的子壳)都将在其后面绘制),并要求窗口管理器激活该壳
代码示例来源:origin: org.codehaus.openxma/xmartclient
/**
* Navigates the browser to the given url.
* @param url the url to show in the browser.
*/
public void Navigate(String url) {
shell.setActive();
swtBrowser.setUrl(url);
}
代码示例来源:origin: org.xworker/xworker_swt
public void run(){
shell.setVisible(true);
shell.setActive();
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event e) {
splash.setVisible(true);
splash.setActive();
}
});
代码示例来源:origin: org.codehaus.openxma/xmartserver
/**
* Navigates the browser to the given url.
* @param url the url to show in the browser.
*/
public void Navigate(String url) {
shell.setActive();
swtBrowser.setUrl(url);
}
代码示例来源:origin: org.xworker/xworker_swt
public void run(){
shell.setVisible(true);
shell.setActive();
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* If the receiver is visible, moves it to the top of the drawing order for
* the display on which it was created (so that all other shells on that
* display, which are not the receiver's children will be drawn behind it) and
* forces the window manager to make the shell active.
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that
* created the receiver</li>
* </ul>
* @since 1.2
* @see Control#moveAbove
* @see Control#setFocus
* @see Control#setVisible
* @see Display#getActiveShell
* @see Decorations#setDefaultButton(Button)
* @see Shell#open
* @see Shell#setActive
*/
public void forceActive() {
checkWidget();
setActive();
}
代码示例来源:origin: openaudible/openaudible
public static void show() {
if (instance != null) {
if (instance.shell.isDisposed()) {
instance = null;
}
}
if (instance == null) {
instance = new LogWindow("Log Window");
} else {
instance.shell.setActive();
}
instance.textPanel.scrollToEnd();
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void activateEditor() {
fEditor.getSite().getShell().setActive();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void bringToTop (boolean force) {
if (getMinimized ()) return;
if (force) {
forceActive ();
} else {
setActive ();
}
}
代码示例来源:origin: org.eclipse.xtext/ui
protected void activateEditor() {
editor.getSite().getShell().setActive();
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private void activateEditor() {
fEditor.getSite().getShell().setActive();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void activateEditor() {
fEditor.getSite().getShell().setActive();
}
代码示例来源:origin: stackoverflow.com
private void shellToFront(final Shell shell)
{
shell.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
if (!shell.getMinimized())
{
shell.setMinimized(true);
}
shell.setMinimized(false);
shell.setActive();
}
});
}
代码示例来源:origin: org.eclipse.egit/ui
@Override
public boolean close() {
// restore shell location if we moved it:
Shell resultShell = getShell();
if (resultShell != null
&& !resultShell.isDisposed()) {
Point location = resultShell.getLocation();
if (location.equals(initialLocation)) {
resultShell.setVisible(false);
resultShell.setLocation(location.x - x,
location.y - y);
}
}
boolean result = super.close();
// activate next result dialog (not the multi-result dialog):
// TODO: This doesn't work due to https://bugs.eclipse.org/388667 :
// Shell[] subShells = shell.getShells();
// if (subShells.length > 0) {
// subShells[subShells.length - 1].setActive();
// }
dialogs.remove(this);
if (dialogs.size() > 0)
dialogs.getLast().getShell().setActive();
return result;
}
};
代码示例来源:origin: openaudible/openaudible
public static void show(Shell s) {
if (instance != null && !instance.getShell().isDisposed()) {
instance.getShell().setActive();
return;
}
try {
Preferences p = instance = new Preferences(s);
int result = instance.open();
if (result == 0) {
try {
AudibleGUI.instance.save();
} catch (IOException e) {
MessageBoxFactory.showError(null, "Error saving preferences");
e.printStackTrace();
}
}
} finally {
instance = null;
}
}
代码示例来源:origin: openaudible/openaudible
public void toggleBrowser() {
if (browser == null) {
createBrowser();
} else {
setBrowserVisible(!isBrowserVisible());
if (isBrowserVisible())
browser.getShell().setActive();
}
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void handleEvent(Event event) {
// Ensure that this event is for a MApplication
if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MApplication))
return;
MWindow win = (MWindow) event
.getProperty(UIEvents.EventTags.NEW_VALUE);
if ((win == null) || !win.getTags().contains("topLevel")) //$NON-NLS-1$
return;
win.setToBeRendered(true);
if (!(win.getRenderer() == WBWRenderer.this))
return;
Shell shell = (Shell) win.getWidget();
if (shell.getMinimized()) {
shell.setMinimized(false);
}
shell.setActive();
shell.moveAbove(null);
}
};
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
@Inject
@Optional
private void subscribeTopicSelectedElementChanged(
@UIEventTopic(UIEvents.ElementContainer.TOPIC_SELECTEDELEMENT) Event event) {
// Ensure that this event is for a MApplication
if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MApplication)) {
return;
}
MWindow win = (MWindow) event.getProperty(UIEvents.EventTags.NEW_VALUE);
if ((win == null) || !win.getTags().contains("topLevel")) { //$NON-NLS-1$
return;
}
win.setToBeRendered(true);
if (!(win.getRenderer() == WBWRenderer.this)) {
return;
}
Shell shell = (Shell) win.getWidget();
if (shell.getMinimized()) {
shell.setMinimized(false);
}
shell.setActive();
shell.moveAbove(null);
}
代码示例来源:origin: stackoverflow.com
private static void bringupDialog(WindowState state) {
final Shell workbenchShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
//bring up the application to front
workbenchShell.setVisible( true );
workbenchShell.setMinimized( false );
workbenchShell.redraw();
//focus on dialog
workbenchShell.setActive();
workbenchShell.forceActive();
workbenchShell.setFocus();
workbenchShell.forceFocus();
workbenchShell.moveAbove( null );
workbenchShell.redraw();
Shell shell = instance.getShell(); // desired window shell
shell.setActive();
shell.forceActive();
shell.setFocus();
shell.forceFocus();
shell.moveAbove( null );
shell.redraw();
}
代码示例来源:origin: BiglySoftware/BiglyBT
protected static void
createChatWindow(
BuddyPluginView view,
BuddyPlugin plugin,
ChatInstance chat,
boolean force_popout )
{
for ( BuddyPluginViewBetaChat win: active_windows ){
if ( win.getChat() == chat ){
Shell existing = win.getShell();
if ( existing.isVisible()){
existing.setActive();
}
chat.destroy();
return;
}
}
if ( !force_popout ){
if ( plugin.getBeta().getWindowsToSidebar()){
if ( BuddyPluginUI.openChat( chat.getNetwork(), chat.getKey())){
chat.destroy();
return;
}
}
}
new BuddyPluginViewBetaChat( view, plugin, chat );
}
内容来源于网络,如有侵权,请联系作者删除!