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

x33g5p2x  于2022-01-23 转载在 其他  
字(11.9k)|赞(0)|评价(0)|浏览(152)

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

List.getDisplay介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements are formatted using the provided {@link ItemFormat}.
 *
 * @param source the EventList that provides the elements
 * @param list the list
 * @param itemFormat an {@link ItemFormat} for formatting the displayed values
 *
 * @see ItemFormat
 * @see GlazedListsSWT#beanItemFormat(String)
 */
public EventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat) {
  super(createProxyList(source, list.getDisplay()), list, itemFormat);
  disposeSource = (this.source != source);
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements are formatted using the provided {@link ItemFormat}.
 *
 * @param source the EventList that provides the elements
 * @param list the list
 * @param itemFormat an {@link ItemFormat} for formatting the displayed values
 *
 * @see ItemFormat
 * @see GlazedListsSWT#beanItemFormat(String)
 */
public EventListViewer(EventList<E> source, List list, ItemFormat<? super E> itemFormat) {
  super(createProxyList(source, list.getDisplay()), list, itemFormat);
  disposeSource = (this.source != source);
}

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

private void initialize() {
  initializeFields();
  for (int i= 0; i < fAppearanceColorListModel.length; i++)
    fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
  fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
    public void run() {
      if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
        fAppearanceColorList.select(0);
        handleAppearanceColorListSelection();
      }
    }
  });
}

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

private void initialize() {
  initializeFields();
  for (int i= 0; i < fAppearanceColorListModel.length; i++)
    fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
  fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
    @Override
    public void run() {
      if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
        fAppearanceColorList.select(0);
        handleAppearanceColorListSelection();
      }
    }
  });
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements are formatted using the provided {@link ItemFormat}.
 * While holding a read lock, this method wraps the source list using
 * {@link GlazedListsSWT#swtThreadProxyList(EventList, Display)}.
 *
 * <p>The returned viewer is <strong>not thread-safe</strong>. Unless otherwise
 * noted, all methods are only safe to be called from the SWT event handler thread.
 * </p>
 *
 * @param source the EventList that provides the elements
 * @param list the list
 * @param itemFormat an {@link ItemFormat} for formatting the displayed values
 */
public static <E> DefaultEventListViewer<E> eventListViewerWithThreadProxyList(EventList<E> source, List list, ItemFormat<? super E> itemFormat) {
  final EventList<E> proxySource = createSwtThreadProxyListWithLock(source, list.getDisplay());
  return new DefaultEventListViewer<E>(proxySource, list, itemFormat, true);
}

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

public void initialize() {
  super.initialize();
  initializeDefaultColors();
  
  for (int i= 0; i < fAppearanceColorListModel.length; i++)
    fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
  
  fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
    public void run() {
      if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
        fAppearanceColorList.select(0);
        handleAppearanceColorListSelection();
      }
    }
  });
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements are formatted using the provided {@link ItemFormat}.
 * While holding a read lock, this method wraps the source list using
 * {@link GlazedListsSWT#swtThreadProxyList(EventList, Display)}.
 *
 * <p>The returned viewer is <strong>not thread-safe</strong>. Unless otherwise
 * noted, all methods are only safe to be called from the SWT event handler thread.
 * </p>
 *
 * @param source the EventList that provides the elements
 * @param list the list
 * @param itemFormat an {@link ItemFormat} for formatting the displayed values
 */
public static <E> DefaultEventListViewer<E> eventListViewerWithThreadProxyList(EventList<E> source, List list, ItemFormat<? super E> itemFormat) {
  final EventList<E> proxySource = createSwtThreadProxyListWithLock(source, list.getDisplay());
  return new DefaultEventListViewer<E>(proxySource, list, itemFormat, true);
}

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

/**
 * Copy the contents of the statuses to the clipboard.
 */
private void copyToClipboard() {
  if (clipboard != null) {
    clipboard.dispose();
  }
  StringBuilder statusBuffer = new StringBuilder();
  populateCopyBuffer(status, statusBuffer, 0);
  clipboard = new Clipboard(list.getDisplay());
  clipboard.setContents(new Object[] { statusBuffer.toString() },
      new Transfer[] { TextTransfer.getInstance() });
}

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

/**
 * Copy the contents of the statuses to the clipboard.
 */
private void copyToClipboard() {
  if (clipboard != null) {
    clipboard.dispose();
  }
  StringBuffer statusBuffer = new StringBuffer();
  populateCopyBuffer(status, statusBuffer, 0);
  clipboard = new Clipboard(list.getDisplay());
  clipboard.setContents(new Object[] { statusBuffer.toString() },
      new Transfer[] { TextTransfer.getInstance() });
}

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

@Override
public void initialize() {
  initializeBracketHighlightingPreferences();
  super.initialize(); // also updates state of slaves, hence it is the second call
  initializeDefaultColors();
  for (int i= 0; i < fAppearanceColorListModel.length; i++)
    fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
  fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
    @Override
    public void run() {
      if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
        fAppearanceColorList.select(0);
        handleAppearanceColorListSelection();
      }
    }
  });
}

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

@Override
public void initialize() {
  initializeBracketHighlightingPreferences();
  super.initialize(); // also updates state of slaves, hence it is the second call
  initializeDefaultColors();
  for (int i= 0; i < fAppearanceColorListModel.length; i++)
    fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
  fAppearanceColorList.getDisplay().asyncExec(new Runnable() {
    @Override
    public void run() {
      if (fAppearanceColorList != null && !fAppearanceColorList.isDisposed()) {
        fAppearanceColorList.select(0);
        handleAppearanceColorListSelection();
      }
    }
  });
}

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

/**
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#initialize()
 */
@Override
protected void initialize() {
  super.initialize();
  for (int i = 0; i < fAppearanceColorListModel.length; i++) {
    fConsoleColorList.add(fAppearanceColorListModel[i][0]);
  }
  fConsoleColorList.getDisplay().asyncExec(() -> {
    if (fConsoleColorList != null && !fConsoleColorList.isDisposed()) {
      fConsoleColorList.select(0);
      handleAppearanceColorListSelection();
    }
  });
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements will simply be displayed as the result of calling
 * toString() on the contents of the source list.
 * While holding a read lock, this method wraps the source list using
 * {@link GlazedListsSWT#swtThreadProxyList(EventList, Display)}.
 *
 * <p>The returned viewer is <strong>not thread-safe</strong>. Unless otherwise
 * noted, all methods are only safe to be called from the SWT event handler thread.
 * </p>
 *
 * @param source the EventList that provides the elements
 * @param list the list
 */
public static <E> DefaultEventListViewer<E> eventListViewerWithThreadProxyList(EventList<E> source, List list) {
  final EventList<E> proxySource = createSwtThreadProxyListWithLock(source, list.getDisplay());
  return new DefaultEventListViewer<E>(proxySource, list, new DefaultItemFormat<E>(), true);
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Creates a new List that displays and responds to changes in the source list.
 * List elements will simply be displayed as the result of calling
 * toString() on the contents of the source list.
 * While holding a read lock, this method wraps the source list using
 * {@link GlazedListsSWT#swtThreadProxyList(EventList, Display)}.
 *
 * <p>The returned viewer is <strong>not thread-safe</strong>. Unless otherwise
 * noted, all methods are only safe to be called from the SWT event handler thread.
 * </p>
 *
 * @param source the EventList that provides the elements
 * @param list the list
 */
public static <E> DefaultEventListViewer<E> eventListViewerWithThreadProxyList(EventList<E> source, List list) {
  final EventList<E> proxySource = createSwtThreadProxyListWithLock(source, list.getDisplay());
  return new DefaultEventListViewer<E>(proxySource, list, new DefaultItemFormat<E>(), true);
}

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

/**
 * Initializes the default colors.
 * 
 * @since 3.3
 */
private void initializeDefaultColors() {
  if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
    RGB rgb= fAppearanceColorList.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
    PreferenceConverter.setValue(getPreferenceStore(), PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, rgb);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

GdkColor temp = getDisplay().COLOR_LIST_BACKGROUND;
  background = display.toGdkRGBA (temp);
} else {
  background = rgba;
GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION;
GdkRGBA selectedBackground = display.toGdkRGBA (defaultColor);
if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {

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

/**
 * Initializes the default colors.
 *
 * @since 3.3
 */
private void initializeDefaultColors() {
  if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
    Display display= fAppearanceColorList.getDisplay();
    RGB rgb= SourceViewerInformationControl.getVisibleBackgroundColor(display);
    if (rgb == null)
      rgb= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
    PreferenceConverter.setValue(getPreferenceStore(), PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, rgb);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

GdkColor temp = getDisplay().COLOR_LIST_BACKGROUND;
  background = display.toGdkRGBA (temp);
} else {
  background = rgba;
GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION;
GdkRGBA selectedBackground = display.toGdkRGBA (defaultColor);
if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {

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

/**
 * Initializes the default colors.
 *
 * @since 3.3
 */
private void initializeDefaultColors() {
  if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
    Display display= fAppearanceColorList.getDisplay();
    RGB rgb= SourceViewerInformationControl.getVisibleBackgroundColor(display);
    if (rgb == null)
      rgb= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
    PreferenceConverter.setValue(getPreferenceStore(), PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, rgb);
  }
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/**
 * Creates a new List that displays and responds to changes in source.
 * List elements are formatted using the provided {@link ILabelProvider}.
 */
public EventListViewer(EventList<E> source, List list, ILabelProvider labelProvider) {
  // lock the source list for reading since we want to prevent writes
  // from occurring until we fully initialize this EventListViewer
  source.getReadWriteLock().readLock().lock();
  try {
    swtThreadSource = GlazedListsSWT.swtThreadProxyList(source, list.getDisplay());
    this.list = list;
    this.labelProvider = labelProvider;
    // Enable the selection lists
    selection = new SelectionManager<E>(swtThreadSource, new SelectableList());
    // setup initial values
    for(int i = 0, n = swtThreadSource.size(); i < n; i++) {
      addRow(i, swtThreadSource.get(i));
    }
    // listen for changes
    swtThreadSource.addListEventListener(this);
  } finally {
    source.getReadWriteLock().readLock().unlock();
  }
}

相关文章

微信公众号

最新文章

更多

List类方法