org.eclipse.jface.util.Util.isWindows()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(210)

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

Util.isWindows介绍

[英]Common WS query helper method.
[中]通用WS-query助手方法。

代码示例

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

/**
 * Returns whether the current platform has support
 * for system in-place editor.
 */
public static boolean inPlaceEditorSupported() {
  // check preference
  if (PrefUtil.getAPIPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.DISABLE_OPEN_EDITOR_IN_PLACE)) {
    return false;
  }
  // only Win32 is supported
  return Util.isWindows();
}

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

/**
 * Determine whether the drop target data is valid.  On some platforms this cannot be detected, 
 * in which which case we return true.
 * @param event the drop target event
 * @return <code>true</code> if data is valid, (or can not be determined), <code>false</code> otherwise.
 */
protected boolean dropTargetDataIsValid(DropTargetEvent event) {
  if (Util.isWindows())
    return URLTransfer.getInstance().nativeToJava(event.currentDataType) != null;
  return true;
}

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

@Override
protected String getKeyStrokeDelimiter() {
  // We must do the look up every time, as our locale might change.
  if (Util.isWindows()) {
    return Util.translateString(RESOURCE_BUNDLE,
        WIN32_KEY_STROKE_DELIMITER_KEY,
        KeySequence.KEY_STROKE_DELIMITER);
  }
  return Util.translateString(RESOURCE_BUNDLE, KEY_STROKE_DELIMITER_KEY,
      KeySequence.KEY_STROKE_DELIMITER);
}

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

@Override
protected String getKeyStrokeDelimiter() {
  // We must do the look up every time, as our locale might change.
  if (org.eclipse.jface.util.Util.isWindows()) {
    return Util.translateString(RESOURCE_BUNDLE,
        WIN32_KEY_STROKE_DELIMITER_KEY,
        KeySequence.KEY_STROKE_DELIMITER, false, false);
  }
  return Util.translateString(RESOURCE_BUNDLE, KEY_STROKE_DELIMITER_KEY, KeySequence.KEY_STROKE_DELIMITER, false,
      false);
}

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

@Override
protected String getKeyStrokeDelimiter() {
  // We must do the look up every time, as our locale might change.
  if (Util.isWindows()) {
    return Util.translateString(RESOURCE_BUNDLE,
        WIN32_KEY_STROKE_DELIMITER_KEY,
        KeySequence.KEY_STROKE_DELIMITER);
  }
  return Util.translateString(RESOURCE_BUNDLE, KEY_STROKE_DELIMITER_KEY,
      KeySequence.KEY_STROKE_DELIMITER);
}

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

/**
 * The default command for launching the system explorer on this platform.
 *
 * @return The default command which launches the system explorer on this system, or an empty
 *         string if no default exists
 * @see ShowInSystemExplorerHandler#getDefaultCommand()
 */
public static String getShowInSystemExplorerCommand() {
  // See https://bugs.eclipse.org/419940 why it is implemented in here and not in ShowInSystemExplorerHandler#getDefaultCommand()
  if (Util.isGtk()) {
    return "dbus-send --print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:\"${selected_resource_uri}\" string:\"\""; //$NON-NLS-1$
  } else if (Util.isWindows()) {
    return "explorer /E,/select=${selected_resource_loc}"; //$NON-NLS-1$
  } else if (Util.isMac()) {
    return "open -R \"${selected_resource_loc}\""; //$NON-NLS-1$
  }
  // if all else fails, return empty default
  return ""; //$NON-NLS-1$
}

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

@Override
public void getSegments(SegmentEvent event) {
  int length = event.lineText.length();
  if (length > 0) {
    boolean isRTL = isRTLValue(event.lineText);
    if (event.widget instanceof Control && Util.isWindows()) {
      if (isRTL) {
        ((Control) event.widget).setOrientation(SWT.RIGHT_TO_LEFT);
      } else {
        ((Control) event.widget).setOrientation(SWT.LEFT_TO_RIGHT);
      }
    } else {
      event.segments = new int[2];
      event.segments[0] = 0;
      event.segments[1] = length;
      event.segmentsChars = new char[2];
      event.segmentsChars[0] = isRTL ? BidiUtils.RLE : BidiUtils.LRE;
      event.segmentsChars[1] = BidiUtils.PDF;
    }
  }
}

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

@Override
public void getSegments(SegmentEvent event) {
  int length = event.lineText.length();
  if (length > 0) {
    boolean isRTL = isRTLValue(event.lineText);
    if (event.widget instanceof Control && Util.isWindows()) {
      if (isRTL) {
        ((Control) event.widget).setOrientation(SWT.RIGHT_TO_LEFT);
      } else {
        ((Control) event.widget).setOrientation(SWT.LEFT_TO_RIGHT);
      }
    } else {
      event.segments = new int[2];
      event.segments[0] = 0;
      event.segments[1] = length;
      event.segmentsChars = new char[2];
      event.segmentsChars[0] = isRTL ? BidiUtils.RLE : BidiUtils.LRE;
      event.segmentsChars[1] = BidiUtils.PDF;
    }
  }
}

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

if (Util.isWindows()) {
  Program.launch(localHref);
} else if (Util.isMac()) {

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

protected String getKeyStrokeDelimiter() {
    // We must do the look up every time, as our locale might change.
    if (Util.isWindows()) {
//            return Util.translateString(RESOURCE_BUNDLE,
      return Util.translateString(getResourceBundle( NativeKeyFormatter.class ),
          WIN32_KEY_STROKE_DELIMITER_KEY, KeySequence.KEY_STROKE_DELIMITER);
    }

//        return Util.translateString(RESOURCE_BUNDLE,
    return Util.translateString(getResourceBundle( NativeKeyFormatter.class ), 
        KEY_STROKE_DELIMITER_KEY, KeySequence.KEY_STROKE_DELIMITER);
  }

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

/**
 * Calculates a rank for a given modifier key.
 *
 * @param modifierKey
 *            The modifier key to rank; may be <code>null</code>.
 * @return The rank of this modifier key. This is a non-negative number
 *         where a lower number suggests a higher rank.
 */
private int rank(ModifierKey modifierKey) {
  if (Util.isWindows()) {
    return rankWindows(modifierKey);
  }
  if (Util.isGtk()) {
    // TODO Do a look-up on window manager.
    return rankGNOME(modifierKey);
  }
  if (Util.isMac()) {
    return rankMacOSX(modifierKey);
  }
  return UNKNOWN_KEY;
}

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

@Override
protected Control createDialogArea(Composite parent) {
  Composite composite = (Composite) super.createDialogArea(parent);
  boolean isWin32 = Util.isWindows();
  GridLayoutFactory.fillDefaults().extendedMargins(isWin32 ? 0 : 3, 3, 2, 2)
      .applyTo(composite);
  Table table = contents.createTable(composite, getDefaultOrientation());
  table.addKeyListener(getKeyAdapter());
  return composite;
}

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

if (retCode != 0 && !Util.isWindows()) {
  return statusReporter.newStatus(IStatus.ERROR, "Execution of '" + launchCmd //$NON-NLS-1$
      + "' failed with return code: " + retCode, null); //$NON-NLS-1$

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

if (Util.isWindows() || SWT.getPlatform().equals(RAP_PLATFORM)) {
  if ((modifierKeys & lookup.getCtrl()) != 0) {
    sortedKeys[index++] = lookup.getCtrl();

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

int index = 0;
if (Util.isWindows()) {
  if ((modifierKeys & lookup.getCtrl()) != 0) {
    sortedKeys[index++] = lookup.getCtrl();

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

int index = 0;
if (Util.isWindows()) {
  if ((modifierKeys & lookup.getCtrl()) != 0) {
    sortedKeys[index++] = lookup.getCtrl();

相关文章