org.eclipse.swt.widgets.Shell.forceActive()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中org.eclipse.swt.widgets.Shell.forceActive()方法的一些代码示例,展示了Shell.forceActive()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.forceActive()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:forceActive

Shell.forceActive介绍

[英]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.
[中]如果接收器可见,则将其移动到创建它的显示器的绘图顺序的顶部(以便该显示器上的所有其他壳(不是接收器的子壳)都将在其后面绘制),并强制窗口管理器使壳处于活动状态。

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
public void shellActivated(ShellEvent e) {
  Shell shellAppModal = Utils.findFirstShellWithStyle(SWT.APPLICATION_MODAL);
  if (shellAppModal != null) {
    shellAppModal.forceActive();
  } else {
    shell.forceActive();
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

/**
 *
 *
 * @since 4.1.0.5
 */
void setFocus(Runnable fire_on_install) {
  synchronized( to_fire_on_complete ){
    to_fire_on_complete.add( fire_on_install );
  }
  shell.forceActive();
  shell.forceFocus();
}

代码示例来源:origin: stackoverflow.com

private void bringToFront(final Shell shell) {
  shell.getDisplay().asyncExec(new Runnable() {
    public void run() {
      shell.forceActive();
    }
  });
}

代码示例来源:origin: BiglySoftware/BiglyBT

private static void showWaitWindow() {
    if ( startupAbandoned ) {
      return;
    }
    if (shell != null && !shell.isDisposed()) {
      shell.forceActive();
      return;
    }

    UIFunctionsSWT uiFunctionsSWT = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (uiFunctionsSWT != null) {
      shell = uiFunctionsSWT.showCoreWaitDlg();
    }
  }
}

代码示例来源:origin: stackoverflow.com

private void bringToFront(final Shell shell) {
    showDesktop(); //minimize all the application
    Thread.sleep(5000); // here have to wait for some time, I am not sure why
    shell.getDisplay().asyncExec(new Runnable() {
    public void run() {
      if(!shell.getMaximized()){
       shell.setMaximized(true);
      }
      shell.forceActive();
    }
 });
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

public void run() {
    getShell().forceActive();
    new CopyFilesAndFoldersOperation(getShell()).copyFiles((String[]) data, target);
    // Import always performs a copy.
    event.detail= DND.DROP_COPY;
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
  public void run() {
    getShell().forceActive();
    new CopyFilesAndFoldersOperation(getShell()).copyOrLinkFiles((String[])data, target, currentOperation);
  }
});

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void bringToTop (boolean force) {
  if (getMinimized ()) return;
  if (force) {
    forceActive ();
  } else {
    setActive ();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.help.ui

public void displayUrl(String url) {
  browser.setUrl(url);
  shell.setMinimized(false);
  shell.forceActive();
}
private void displayURLExternal(WindowEvent e) {

代码示例来源:origin: org.xworker/xworker_swt

public void run(){
    ActionContext ac = explorerActions.getActionContext();
    Shell shell = (Shell) ac.get("shell");
    if(shell != null){
      shell.forceActive();
    }
    
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("thing", thing);
    explorerActions.doAction("openThing", parameters);;
  }
});

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public void run() {
    getShell().forceActive();
    new CopyFilesAndFoldersOperation(getShell()).copyOrLinkFiles((String[])data, target, currentOperation);
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

public void show() {
 if(updateWindow == null || updateWindow.isDisposed()) {
  return;
 }
 Utils.centreWindow( updateWindow );
 updateWindow.setMinimized(false);
 updateWindow.open();
 updateWindow.forceActive();
}

代码示例来源:origin: org.xworker/xworker_swt

public void run(){
  if(actions == null) {
    logger.warn("Actions is null, action=" + name);
    return;
  }
  
  ActionContext ac = actions.getActionContext();
  Shell shell = (Shell) ac.get("shell");
  if(shell != null){
    shell.forceActive();
  }
  result = actions.doAction(name, parameters);
}

代码示例来源:origin: org.codehaus.openxma/xmartclient

/**
 * Brings the window representing this page to the foreground.
 *
 * @since version_number
 * @author s3460
 */
public void activatePage(){
  Shell shell = getDialog().getShell();
  if(shell.getDisplay().getActiveShell() != shell){
    shell.forceActive();
    //shell.setMinimized(true);
    //shell.setMinimized(false);
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void runSupport() {
    if (window == null) {
      window = new PasswordWindow(display);
      window.open();
    } else {
      window.shell.setVisible(true);
      window.shell.forceActive();
    }
    if (bSWTThread) {
      window.run();
    }
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

private void showMainWindow() {
  uiFunctions.bringToFront(false);
  uiFunctions.getMainShell().forceActive();
  uiFunctions.getMainShell().forceFocus();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

private void handleException(Throwable t) {
  try {
    exceptionCount++;
    if (exceptionCount > 1) {
      dialog.updateMessage(MessageFormat.format(MSG_FATAL_ERROR,
          new Object[] { MSG_FATAL_ERROR_Recursive }));
      dialog.getShell().forceActive();
    } else {
      if (openQuestionDialog(t)) {
        closeWorkbench();
      }
    }
  } finally {
    exceptionCount--;
  }
}

代码示例来源:origin: infinitest/infinitest

public void show(final Shell dialog) {
  createMessage(dialog);
  createList(dialog);
  sizeDialog(dialog);
  moveToParentDialogCenter(dialog);
  dialog.open();
  dialog.forceActive();
  dialog.addShellListener(new DialogDeactivationDisposer(dialog));
}

代码示例来源:origin: BiglySoftware/BiglyBT

private void
swt_activate()
{
  Shell shell = dlg.getShell();
  if ( !shell.isDisposed()){
    Utils.dump( shell );
    if ( !shell.isVisible()){
      shell.setVisible( true );
    }
    shell.forceActive();
      // trying to debug some weird hidden dialog issue - on second opening revalidate
      // everything to see if this fixes things
    shell.layout( true,  true );
    Utils.verifyShellRect( shell, true );
    Utils.centreWindow( shell );
    Utils.dump( shell );
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

/**
 * Performs a drop using the FileTransfer transfer type.
 */
private IStatus performFileDrop(Object data) {
  MultiStatus problems = new MultiStatus(PlatformUI.PLUGIN_ID, 0,
      ResourceNavigatorMessages.DropAdapter_problemImporting, null);
  mergeStatus(problems, validateTarget(getCurrentTarget(),
      getCurrentTransfer()));
  final int currentOperation= getCurrentOperation();
  final IContainer target = getActualTarget((IResource) getCurrentTarget());
  final String[] names = (String[]) data;
  // Run the import operation asynchronously.
  // Otherwise the drag source (e.g., Windows Explorer) will be blocked
  // while the operation executes. Fixes bug 16478.
  Display.getCurrent().asyncExec(() -> {
    getShell().forceActive();
    new CopyFilesAndFoldersOperation(getShell()).copyOrLinkFiles(names, target, currentOperation);
  });
  return problems;
}

相关文章

微信公众号

最新文章

更多

Shell类方法