org.eclipse.swt.SWT类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(136)

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

SWT介绍

[英]This class provides access to a small number of SWT system-wide methods, and in addition defines the public constants provided by SWT.

By defining constants like UP and DOWN in a single class, SWT can share common names and concepts at the same time minimizing the number of classes, names and constants for the application programmer.

Note that some of the constants provided by this class represent optional, appearance related aspects of widgets which are available either only on some window systems, or for a differing set of widgets on each window system. These constants are marked as HINTs. The set of widgets which support a particular HINT may change from release to release, although we typically will not withdraw support for a HINT once it is made available.
[中]此类提供了对少量SWT系统范围方法的访问,此外还定义了SWT提供的公共常量。
通过在单个类中定义UP和DOWN等常量,SWT可以共享通用名称和概念,同时为应用程序程序员减少类、名称和常量的数量。
请注意,这个类提供的一些常量代表了可选的、与外观相关的小部件方面,这些小部件要么仅在某些窗口系统上可用,要么在每个窗口系统上用于不同的小部件集。这些常量被标记为HINTs。支持特定HINT的小部件集可能会随着版本的变化而变化,尽管我们通常不会在HINT可用后撤销对它的支持。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

public static final boolean isMac() {
 final String ws = SWT.getPlatform();
 return WS_CARBON.equals( ws ) || WS_COCOA.equals( ws );
}

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

static ExpandBar checkNull( ExpandBar control ) {
 if( control == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 return control;
}

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

@Override
public void getDefaultAction(AccessibleControlEvent e) {
  String action = null;
  int childID = e.childID;
  if (childID >= 0 && childID < items.length) {
    action = SWT.getMessage ("SWT_Switch"); //$NON-NLS-1$
  }
  e.result = action;
}

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

public
SWTVersionGetter(
    UpdateChecker    _checker )
{
   this.platform = SWT.getPlatform();
 this.currentVersion = SWT.getVersion();
 this.latestVersion = 0;
 checker    = _checker;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Constructs a new instance of this class with its
 * stack trace and error code filled in.
 *
 * @param code the SWT error code
 */
public SWTException (int code) {
  this (code, SWT.findErrorText (code));
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

int get_toolkitVersion(int /*long*/ pbstrVersion) {
  String toolkitVersion = "" + SWT.getVersion(); //$NON-NLS-1$
  if (DEBUG) print(this + ".IAccessibleApplication::get_toolkitVersion() returning" + toolkitVersion + hresult(COM.S_OK));
  setString(pbstrVersion, toolkitVersion);
  return COM.S_OK;
}

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

public static int computeColorNr( int red, int green, int blue, int alpha ) {
 if(    red > 255 || red < 0
   || green > 255 || green < 0
   || blue > 255 || blue < 0
   || alpha > 255 || alpha < 0 )
 {
  SWT.error( SWT.ERROR_INVALID_ARGUMENT );
 }
 return red | green << 8 | blue << 16 | alpha << 24;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
public void getDefaultAction (AccessibleControlEvent e) {
  e.result = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
}

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

/**
 * Constructs a new instance of this class with its
 * stack trace and error code filled in.
 *
 * @param code the SWT error code
 */
public SWTError (int code) {
  this (code, SWT.findErrorText (code));
}

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

static float[] checkTransform( float[] elements ) {
 if( elements == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 if( elements.length < 6 ) {
  SWT.error( SWT.ERROR_INVALID_ARGUMENT );
 }
 return elements;
}

代码示例来源:origin: pentaho/pentaho-kettle

public static final boolean isWindows() {
 final String ws = SWT.getPlatform();
 return WS_WIN32.equals( ws ) || WS_WPF.equals( ws );
}

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

@Override
public void getDefaultAction (AccessibleControlEvent e) {
  e.result = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
}

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

/**
 * Constructs a new instance of this class with its 
 * stack trace and error code filled in.
 *
 * @param code the SWT error code
 */
public SWTError (int code) {
  this (code, SWT.findErrorText (code));
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void setLineWidthInPixels(int lineWidth) {
  if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
  if (data.lineWidth == lineWidth) return;
  data.lineWidth = lineWidth;
  data.state &= ~(LINE_WIDTH | DRAW_OFFSET);
}

代码示例来源:origin: pentaho/pentaho-kettle

if ( item.getParentItem() != null && item.getParentItem().equals( wTreeScriptsItem ) ) {
 if ( item != null && item == lastItem[0] ) {
  boolean isCarbon = SWT.getPlatform().equals( "carbon" );
  final Composite composite = new Composite( wTree, SWT.NONE );
  if ( !isCarbon ) {

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

@Override
public void getDefaultAction (AccessibleControlEvent e) {
  e.result = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
}

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

/**
 * Constructs a new instance of this class with its
 * stack trace and error code filled in.
 *
 * @param code the SWT error code
 */
public SWTException (int code) {
  this (code, SWT.findErrorText (code));
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Throws an appropriate exception based on the passed in error code.
 *
 * @param code the SWT error code
 */
public static void error (int code) {
  error (code, null);
}

代码示例来源:origin: pentaho/pentaho-kettle

if ( item.getParentItem() != null && item.getParentItem().equals( wTreeClassesItem ) ) {
 if ( item != null && item == lastItem[0] ) {
  boolean isCarbon = SWT.getPlatform().equals( "carbon" );
  final Composite composite = new Composite( wTree, SWT.NONE );
  if ( !isCarbon ) {

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

@Override
public void getDefaultAction (AccessibleControlEvent e) {
  e.result = SWT.getMessage ("SWT_Press"); //$NON-NLS-1$
}

相关文章