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

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

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

Text.getShell介绍

暂无

代码示例

代码示例来源:origin: cbeust/testng-eclipse

public void widgetSelected(SelectionEvent evt) {
  DirectoryDialog dlg= new DirectoryDialog(m_xmlTemplateFile.getShell());
  dlg.setMessage("Select TestNG Output Directory");
  String selectedDir = dlg.open();
  if (new File(selectedDir).isDirectory()) {
   // use xml reporter file name as String literal rather than constant
   // since XMLReporter.FILE_NAME was moved in https://github.com/cbeust/testng/pull/1785
   selectedDir = selectedDir + File.separator + "testng-results.xml";
  }
  m_watchResultText.setText(selectedDir != null ? selectedDir : "");
 }
};

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

protected void handleVariablesButtonSelected() {
  StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(fDictionaryPath.getShell());
  if (dialog.open() == Window.OK)
    fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
  public Point getLocation(Point tipSize, Event event) {
    return messageLabel.getShell().toDisplay(messageLabel.getLocation());
  }
};

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

@Override
  public Point getLocation(Point tipSize, Event event) {
    return messageLabel.getShell().toDisplay(messageLabel.getLocation());
  }
};

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

protected void handleVariablesButtonSelected() {
  StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(fDictionaryPath.getShell());
  if (dialog.open() == Window.OK)
    fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}

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

protected void handleFileBrowseButtonPressed(Text text, String[] extensions, String title) {
  FileDialog dialog= new FileDialog(text.getShell());
  dialog.setText(title);
  dialog.setFilterExtensions(extensions);
  String dirName= text.getText();
  if (!dirName.equals("")) { //$NON-NLS-1$
    File path= new File(dirName);
    if (path.exists())
      dialog.setFilterPath(dirName);
  }
  String selectedDirectory= dialog.open();
  if (selectedDirectory != null)
    text.setText(selectedDirectory);
}

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

protected void handleFileBrowseButtonPressed(Text text, String[] extensions, String title) {
  FileDialog dialog= new FileDialog(text.getShell());
  dialog.setText(title);
  dialog.setFilterExtensions(extensions);
  String dirName= text.getText();
  if (!dirName.equals("")) { //$NON-NLS-1$
    File path= new File(dirName);
    if (path.exists())
      dialog.setFilterPath(dirName);
  }
  String selectedDirectory= dialog.open();
  if (selectedDirectory != null)
    text.setText(selectedDirectory);
}

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

/**
 * Handles selections of the browse button.
 */
protected void handleBrowseButtonSelected() {
  final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN);
  dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title);
  dialog.setFilterPath(fDictionaryPath.getText());
  final String path= dialog.open();
  if (path != null)
    fDictionaryPath.setText(path);
}

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

/**
 * Handles selections of the browse button.
 */
protected void handleBrowseButtonSelected() {
  final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN | SWT.SHEET);
  dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title);
  dialog.setFilterPath(fDictionaryPath.getText());
  final String path= dialog.open();
  if (path != null)
    fDictionaryPath.setText(path);
}

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

/**
 * Handles selections of the browse button.
 */
protected void handleBrowseButtonSelected() {
  final FileDialog dialog= new FileDialog(fDictionaryPath.getShell(), SWT.OPEN);
  dialog.setText(PreferencesMessages.SpellingPreferencePage_filedialog_title); 
  dialog.setFilterPath(fDictionaryPath.getText());
  final String path= dialog.open();
  if (path != null)
    fDictionaryPath.setText(path);
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

private static boolean hasSelectionListener( final Text text ) {
 // Emulate SWT (on Windows) where a default button takes precedence over
 // a SelectionListener on a text field when both are on the same shell.
 Button defButton = text.getShell().getDefaultButton();
 // TODO [rst] On GTK, the SelectionListener is also off when the default
 //      button is invisible or disabled. Check with Windows and repair.
 boolean hasDefaultButton = defButton != null && defButton.isVisible();
 return !hasDefaultButton && SelectionEvent.hasListener( text );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

boolean hasFocus() {
    if (text == null || text.isDisposed()) {
      return false;
    }
    return text.getShell().isFocusControl()
        || text.isFocusControl();
  }
}

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

protected void handleBrowseWorkspace() {
  ContainerSelectionDialog dialog = new ContainerSelectionDialog(fLocationText.getShell(), getContainer(), true, PDEUIMessages.BaseBlock_relative);
  if (dialog.open() == Window.OK) {
    Object[] result = dialog.getResult();
    if (result.length == 0)
      return;
    IPath path = (IPath) result[0];
    fLocationText.setText("${workspace_loc:" + path.makeRelative().toString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

boolean hasFocus() {
    if (text == null || text.isDisposed()) {
      return false;
    }
    return text.getShell().isFocusControl()
        || text.isFocusControl();
  }
}

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

boolean hasFocus() {
    if (text == null || text.isDisposed()) {
      return false;
    }
    return text.getShell().isFocusControl()
        || text.isFocusControl();
  }
}

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

/**
 * The browse button has been selected. Select the location.
 */
protected void handleLocationFileButtonPressed() {
  final FileDialog certFileDialog = new FileDialog(filePathField.getShell(), SWT.OPEN);
  certFileDialog.setText(SecurityUIMsg.WIZARD_SELECT_FILE);
  certFileDialog.setFilterPath(filePathField.getText());
  certFileDialog.setFilterExtensions(new String[] {"*.cer", "*.p7b", "*.der"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  String selectedCert = certFileDialog.open();
  if (selectedCert != null) {
    filePathField.setText(selectedCert);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.security.ui

/**
 * The browse button has been selected. Select the location.
 */
protected void handleLocationFileButtonPressed() {
  final FileDialog certFileDialog = new FileDialog(filePathField.getShell(), SWT.OPEN);
  certFileDialog.setText(SecurityUIMsg.WIZARD_SELECT_FILE);
  certFileDialog.setFilterPath(filePathField.getText());
  certFileDialog.setFilterExtensions(new String[] {"*.cer", "*.p7b", "*.der"}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
  String selectedCert = certFileDialog.open();
  if (selectedCert != null) {
    filePathField.setText(selectedCert);
  }
}

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

private void handleInsertVariable() {
  StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(fLocationText.getShell());
  if (dialog.open() == Window.OK)
    fLocationText.insert(dialog.getVariableExpression());
}

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

protected void handleBrowseFileSystem() {
  DirectoryDialog dialog = new DirectoryDialog(fLocationText.getShell());
  dialog.setFilterPath(getLocation());
  dialog.setText(PDEUIMessages.BaseBlock_dirSelection);
  dialog.setMessage(PDEUIMessages.BaseBlock_dirChoose);
  String result = dialog.open();
  if (result != null)
    fLocationText.setText(result);
}

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

public static CodeAssistor attach(Thing thing, Text text, ActionContext actionContext){
  Shell shell = text.getShell();		
  CodeAssistor codeAssistor = (CodeAssistor) text.getData(key + "Assistor");
  if(codeAssistor == null){
    codeAssistor = new CodeAssistor(shell);
    text.setData(key + "Assistor", codeAssistor);
    text.addKeyListener(codeAssistor);
  }
  codeAssistor.initCache(actionContext);
  text.setData(key, actionContext);
  text.setData(keyThing, thing);
  codeAssistor.varActionContext = actionContext;
  
  return codeAssistor;
}

相关文章

Text类方法