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

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

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

Util.isGtk介绍

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

代码示例

代码示例来源: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.ui.workbench

private List<ITheme> getCSSThemes(boolean highContrastMode) {
  ArrayList<ITheme> themes = new ArrayList<>();
  for (ITheme theme : engine.getThemes()) {
    /*
     * When we have Win32 OS - when the high contrast mode is enabled on
     * the platform, we display the 'high-contrast' special theme only.
     * If not, we don't want to mess the themes combo with the theme
     * since it is the special variation of the 'classic' one
     *
     * When we have GTK - we have to display the entire list of the
     * themes since we are not able to figure out if the high contrast
     * mode is enabled on the platform. The user has to manually select
     * the theme if they need it
     */
    if (!highContrastMode && !Util.isGtk()
        && theme.getId().equals(E4Application.HIGH_CONTRAST_THEME_ID)) {
      continue;
    }
    themes.add(theme);
  }
  themes.sort((ITheme t1, ITheme t2) -> t1.getLabel().compareTo(t2.getLabel()));
  return themes;
}

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

public void repaint() {
  if (!isDisposed()) {
    GC gc= new GC(this);
    doubleBufferPaint(gc);
    gc.dispose();
    if (Util.isGtk()) {
      redraw();
    }
  }
}

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

if (Util.isGtk()) {

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

if (Util.isGtk()) {

代码示例来源: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

if (Util.isGtk()) {
  switch (color) {
  case "foreground": //$NON-NLS-1$

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

long timeout = Util.isGtk() ? 100 : 0;
clearJob.schedule(timeout);

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

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

/**
 * Show the dialog's menu. This message has no effect if the receiver was
 * not configured to show a menu. Clients may call this method in order to
 * trigger the menu via keystrokes or other gestures. Subclasses typically
 * do not override method.
 */
protected void showDialogMenu() {
  if (!showDialogMenu) {
    return;
  }
  if (menuManager == null) {
    menuManager = new MenuManager();
    fillDialogMenu(menuManager);
  }
  // Setting this flag works around a problem that remains on X only,
  // whereby activating the menu deactivates our shell.
  listenToDeactivate = !Util.isGtk();
  Menu menu = menuManager.createContextMenu(getShell());
  Rectangle bounds = toolBar.getBounds();
  Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
  topLeft = getShell().toDisplay(topLeft);
  menu.setLocation(topLeft.x, topLeft.y);
  menu.setVisible(true);
}

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

private void updateQuickAccessText() {
  if (txtQuickAccess == null || txtQuickAccess.isDisposed()) {
    return;
  }
  updateQuickAccessTriggerSequence();
  if (triggerSequence != null) {
    txtQuickAccess.setToolTipText(
        NLS.bind(QuickAccessMessages.QuickAccess_TooltipDescription, triggerSequence.format()));
  } else {
    txtQuickAccess.setToolTipText(QuickAccessMessages.QuickAccess_TooltipDescription_Empty);
  }
  GC gc = new GC(txtQuickAccess);
  // workaround for Bug 491317
  if (Util.isWin32() || Util.isGtk()) {
    FontMetrics fm = gc.getFontMetrics();
    int wHint = QuickAccessMessages.QuickAccess_EnterSearch.length() * fm.getAverageCharWidth();
    int hHint = fm.getHeight();
    gc.dispose();
    txtQuickAccess.setSize(txtQuickAccess.computeSize(wHint, hHint));
  } else {
    Point p = gc.textExtent(QuickAccessMessages.QuickAccess_EnterSearch);
    Rectangle r = txtQuickAccess.computeTrim(0, 0, p.x, p.y);
    gc.dispose();
    // computeTrim() may result in r.x < 0
    GridDataFactory.fillDefaults().hint(r.width - r.x, SWT.DEFAULT).applyTo(txtQuickAccess);
  }
  txtQuickAccess.requestLayout();
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

final int ignoreEventCount = Util.isGtk() ? 4 : 1;

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

if (!Util.isGtk()) {
    asyncClose();
} else if (Util.isGtk()) {

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

if (!Util.isGtk()) {
    asyncClose();
} else if (Util.isGtk()) {

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

if ((Util.isGtk()) && (callback instanceof IBindingManagerCallback)
    && (commandId != null)) {
  final IBindingManagerCallback bindingManagerCallback = (IBindingManagerCallback) callback;

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

final int ignoreEventCount = Util.isGtk() ? 4 : 1;

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

} else if (Util.isGtk() || Util.isMotif()) {
  if ((modifierKeys & lookup.getShift()) != 0) {
    sortedKeys[index++] = lookup.getShift();

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

} else if (Util.isGtk()) {
  if ((modifierKeys & lookup.getShift()) != 0) {
    sortedKeys[index++] = lookup.getShift();

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

} else if (Util.isGtk() || Util.isMotif()) {
  if ((modifierKeys & lookup.getShift()) != 0) {
    sortedKeys[index++] = lookup.getShift();

相关文章