当前位置: 首页>>代码示例>>Java>>正文


Java SWT类代码示例

本文整理汇总了Java中org.eclipse.swt.SWT的典型用法代码示例。如果您正苦于以下问题:Java SWT类的具体用法?Java SWT怎么用?Java SWT使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SWT类属于org.eclipse.swt包,在下文中一共展示了SWT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import org.eclipse.swt.SWT; //导入依赖的package包/类
@Override
protected void show ()
{
    super.show ();

    final int tabIndex = findIndex ( this.index );

    if ( tabIndex < 0 )
    {
        this.item = new TabItem ( this.folder, SWT.NONE );
        this.item.setData ( "order", this.index );
    }
    else
    {
        this.item = new TabItem ( this.folder, SWT.NONE, tabIndex );
        this.item.setData ( "order", this.index );
    }

    this.item.setControl ( this.container );

    useItem ( this.item );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:NativeTabProvider.java

示例2: createControl

import org.eclipse.swt.SWT; //导入依赖的package包/类
@Override
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(2, true));

    new Label(container, SWT.NONE).setText(Messages.DiffWizard_source + ':');
    new Label(container, SWT.NONE).setText(Messages.DiffWizard_target + ':');
    lblSource = new Label(container, SWT.WRAP);
    lblTarget = new Label(container, SWT.WRAP);

    diffTable = new DiffTableViewer(container, false, null);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1);
    gd.widthHint = 480;
    gd.heightHint = 360;
    diffTable.setLayoutData(gd);

    setControl(container);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:19,代码来源:DiffWizard.java

示例3: handleEvent

import org.eclipse.swt.SWT; //导入依赖的package包/类
@Override
public void handleEvent(Event event){

    if(encryptToggle.getSelection()){
        Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.encrypted");
        originalColor = encryptToggle.getForeground();
        //Color highlightColor = ColorCache.getColor(display,178,78,127);
        Color highlightColor = Colors.getSystemColor(display, SWT.COLOR_DARK_YELLOW);
        encryptToggle.setBackground(highlightColor);
    }else{
        Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.standard");
        if(originalColor!=null){
            encryptToggle.setBackground(originalColor);
        }
    }
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:17,代码来源:SpeedTestPanel.java

示例4: ParameterGridDialog

import org.eclipse.swt.SWT; //导入依赖的package包/类
/**
 * Create the dialog.
 * @param parentShell
 */
public ParameterGridDialog(Shell parentShell) {
	super(parentShell);
	setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL);
	runGraph=false;
	
	
	lastRowLastColumnTraverseListener=new TraverseListener() {
		
		@Override
		public void keyTraversed(TraverseEvent e) {
			if(e.detail == SWT.TRAVERSE_TAB_NEXT)
				addRowToTextGrid();
		}
	};
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:ParameterGridDialog.java

示例5: createGroupDecoration

import org.eclipse.swt.SWT; //导入依赖的package包/类
/**
 * This method initializes groupDecoration	
 *
 */
private void createGroupDecoration() {
	GridData gridData1 = new org.eclipse.swt.layout.GridData();
	gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData1.horizontalSpan = 2;
	gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
	groupDecoration = new Group(this, SWT.NONE);
	groupDecoration.setText("Decoration");
	createCompositeIntense();
	groupDecoration.setLayoutData(gridData1);
	createCompositeReverse();
	createCompositeUnderline();
	createCompositeBlink();
	
	
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:JavelinAttributeEditorComposite.java

示例6: createUploadLimitMenu

import org.eclipse.swt.SWT; //导入依赖的package包/类
/**
 * Creates the global upload limit context menu item
 * @param parent The system tray contextual menu
 */
private final void createUploadLimitMenu(final Menu parent) {
	if ( gm == null ){
		return;
	}
	final MenuItem uploadSpeedItem = new MenuItem(parent, SWT.CASCADE);
	uploadSpeedItem.setText(MessageText.getString("GeneralView.label.maxuploadspeed"));

	final Menu uploadSpeedMenu = new Menu(uiFunctions.getMainShell(),
			SWT.DROP_DOWN);

	uploadSpeedMenu.addListener(SWT.Show, new Listener() {
		@Override
		public void handleEvent(Event event) {
			SelectableSpeedMenu.generateMenuItems(uploadSpeedMenu, core, gm, true);
		}
	});

	uploadSpeedItem.setMenu(uploadSpeedMenu);
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:24,代码来源:SystemTraySWT.java

示例7: createContents

import org.eclipse.swt.SWT; //导入依赖的package包/类
@Override
protected Control createContents(Composite parent) {
	Composite composite = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	composite.setLayout(layout);
	composite.setFont(parent.getFont());

	GridData data = new GridData(GridData.FILL, GridData.FILL, true, true);

	configurationBlockControl = super.createContents(composite);
	configurationBlockControl.setLayoutData(data);

	if (isProjectPreferencePage()) {
		boolean useProjectSpecificSettings = hasProjectSpecificOptions();
		enableProjectSpecificSettings(useProjectSpecificSettings);
	}

	Dialog.applyDialogFont(composite);
	return composite;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:23,代码来源:AbstractN4JSPreferencePage.java

示例8: createDialogArea

import org.eclipse.swt.SWT; //导入依赖的package包/类
/**
 * Create contents of the dialog.
 * 
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
	container.getShell().setText(this.windowLabel);
	
	Composite main_composite = new Composite(container, SWT.NONE);
	main_composite.setLayout(new GridLayout(1, false));
	main_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	createTopComposite(main_composite);

	createTableComposite(main_composite);

	populateWidget();

	return container;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:ExcelFormattingDialog.java

示例9: configureText

import org.eclipse.swt.SWT; //导入依赖的package包/类
void configureText(final Composite parent) {
	// Don't set caret to 'null' as this causes
	// https://bugs.eclipse.org/293263.
	// text.setCaret(null);
	Color background = JFaceColors.getBannerBackground(parent.getDisplay());
	Color foreground = JFaceColors.getBannerForeground(parent.getDisplay());

	text.setFont(parent.getFont());
	text.setText(item.getText());

	text.setBackground(background);
	text.setForeground(foreground);
	text.setMargins(TEXT_MARGIN, TEXT_MARGIN, TEXT_MARGIN, 0);

	GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
	text.setLayoutData(gd);

	aboutTextManager = new AboutTextManager(text);
	aboutTextManager.setItem(item);

	createTextMenu();

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:24,代码来源:CustomAboutDialog.java

示例10: showPreferenceDialogMAC

import org.eclipse.swt.SWT; //导入依赖的package包/类
private SWTBotShell showPreferenceDialogMAC() {
	final IWorkbench workbench = PlatformUI.getWorkbench();
	workbench.getDisplay().asyncExec(new Runnable() {
		public void run() {
			IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
			if (window != null) {
				Menu appMenu = workbench.getDisplay().getSystemMenu();
				for (MenuItem item : appMenu.getItems()) {
					if (item.getText().startsWith("Preferences")) {
						Event event = new Event();
						event.time = (int) System.currentTimeMillis();
						event.widget = item;
						event.display = workbench.getDisplay();
						item.setSelection(true);
						item.notifyListeners(SWT.Selection, event);
						break;
					}
				}
			}
		}
	});
	return  getPreferenceDialog() ;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:24,代码来源:GW4EPreferencePage.java

示例11: updateSymbol

import org.eclipse.swt.SWT; //导入依赖的package包/类
private void updateSymbol ()
{
    if ( this.symbolArea == null )
    {
        // too early
        return;
    }

    this.loadedUris.clear ();

    if ( this.viewer != null )
    {
        this.viewer.dispose ();
        this.viewer = null;
    }

    final Symbol symbol = getSymbol ();
    if ( symbol != null )
    {
        final Map<String, String> properties = new HashMap<> ();
        final SymbolLoader symbolLoader = new StaticSymbolLoader ( symbol );
        final Map<String, Object> scriptObjects = new HashMap<> ();
        this.viewer = new VisualInterfaceViewer ( this.symbolArea, SWT.NONE, symbolLoader, scriptObjects, properties, this.factoryContext );
    }
    this.symbolArea.layout ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:27,代码来源:PreviewEditorImpl.java

示例12: isCollapsed

import org.eclipse.swt.SWT; //导入依赖的package包/类
/**
 * When any <code>ProgressReporterPanel</code> in this window is expanded or collapsed
 * re-layout the controls and window appropriately
 */
@Override
public void isCollapsed(boolean value) {
	if (null != shell && !shell.isDisposed()) {
		scrollable.setRedraw(false);
		Rectangle r = scrollable.getClientArea();
		scrollable.setMinSize(scrollChild.computeSize(r.width, SWT.DEFAULT));

		/*
		 * Resizing to fit the panel if there is only one
		 */
		if (pReporters.length == 1) {
			Point p = shell.computeSize(defaultShellWidth, SWT.DEFAULT);
			if (shell.getSize().y != p.y) {
				p.x = shell.getSize().x;
				shell.setSize(p);
			}
		}

		scrollable.layout();
		scrollable.setRedraw(true);
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:27,代码来源:ProgressReporterWindow.java

示例13: createPartControl

import org.eclipse.swt.SWT; //导入依赖的package包/类
public void createPartControl(Composite parent) {
	try {
		parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		GridLayout gridLayout = new GridLayout();
		parent.setLayout(gridLayout);
		gridLayout.horizontalSpacing = 0;
		gridLayout.marginWidth = 0;
		gridLayout.marginHeight = 0;
		gridLayout.verticalSpacing = 0;

		GridData gridData = new GridData();
		gridData.horizontalAlignment = GridData.FILL;
		gridData.verticalAlignment = GridData.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.grabExcessVerticalSpace = true;
		
		SequenceEditorInput sequenceEditorInput = (SequenceEditorInput) getEditorInput();
		
		sequenceEditorPart = new SequenceEditorPart(this, sequenceEditorInput.sequence, parent, SWT.None);
		sequenceEditorPart.setLayoutData(gridData);
	}
	catch(Throwable e) {
		ConvertigoPlugin.logException(e, "Unable to create editor part");
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:26,代码来源:SequenceEditor.java

示例14: updateButtonVisibility

import org.eclipse.swt.SWT; //导入依赖的package包/类
private void updateButtonVisibility(final Tag[] tags) {
 	Utils.execSWTThread(new AERunnable() {

		@Override
		public void runSupport() {
			if (btnAnyTags == null || btnAnyTags.isDisposed()) {
				return;
			}
			boolean show = tags != null && tags.length > 1;
			btnAnyTags.setVisible(show);
			FormData fd = Utils.getFilledFormData();
			fd.height = show ? SWT.DEFAULT : 0;
			btnAnyTags.setLayoutData(fd);
			Composite cTop = btnAnyTags.getParent();
			cTop.getParent().layout(true, true);
		}
	});
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:19,代码来源:MyTorrentsSubView.java

示例15: onClick

import org.eclipse.swt.SWT; //导入依赖的package包/类
protected void onClick(MouseEvent event) {
	// update selection
	final Node mNode = getNodeAt(event.x, event.y);
	final boolean shiftPressed = (event.stateMask & SWT.SHIFT) != 0;
	if (!shiftPressed) {
		if (mNode == null) {
			clearSelection();
		} else {
			setSelectedNodes(mNode);
		}
	} else {
		if (mNode == null) {
			// do nothing
		} else {
			toggleSelection(mNode);
		}
	}
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:19,代码来源:GraphCanvas.java


注:本文中的org.eclipse.swt.SWT类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。