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


Java ColorSelector.getButton方法代码示例

本文整理汇总了Java中org.eclipse.jface.preference.ColorSelector.getButton方法的典型用法代码示例。如果您正苦于以下问题:Java ColorSelector.getButton方法的具体用法?Java ColorSelector.getButton怎么用?Java ColorSelector.getButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.preference.ColorSelector的用法示例。


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

示例1: createBinding

import org.eclipse.jface.preference.ColorSelector; //导入方法依赖的package包/类
@Override
public Binding createBinding(DetailProviderParameter p) {
	FormToolkit toolkit = p.getDetailFormToolkit();
	Composite parent = p.getParent();
	EObject target = p.getTarget();
	IItemPropertyDescriptor pd = p.getPropertyDescriptor();
	EStructuralFeature feature = (EStructuralFeature) pd.getFeature(target);
	if (feature == null) {
		return null;
	}
	boolean isEditable = pd.canSetProperty(target);
	EMFDetailUtils.createLabel(parent, toolkit, target, pd);
	Composite composite = createPaddingComposite(toolkit, parent);
	ColorSelector colorSelector = new ColorSelector(composite);
	Button button = colorSelector.getButton();
	button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, true));
	button.setEnabled(isEditable);
	toolkit.adapt(button, true, true);
	EMFDetailUtils.bindControlViability(p, new Control[] {button});
	return EMFDetailUtils.bindEMFUndoable(p, new RGBSelectorObservableValue(colorSelector, ERGB.class == feature.getEType().getInstanceClass()));
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:22,代码来源:RGBBindingFactory.java

示例2: createStylesComposite

import org.eclipse.jface.preference.ColorSelector; //导入方法依赖的package包/类
private void createStylesComposite(Composite editorComposite) {
	GridLayout layout;
	GridData gd;
	Composite stylesComposite = new Composite(editorComposite, SWT.NONE);
	layout = new GridLayout();
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.numColumns = 2;
	stylesComposite.setLayout(layout);
	stylesComposite.setLayoutData(new GridData(GridData.END, GridData.FILL, false, true));
	
	fEnableCheckbox = new Button(stylesComposite, SWT.CHECK);
	fEnableCheckbox.setText("Enable");
	gd = new GridData(GridData.FILL_HORIZONTAL);
	gd.horizontalAlignment = GridData.BEGINNING;
	gd.horizontalSpan = 2;
	fEnableCheckbox.setLayoutData(gd);
	
	fColorEditorLabel = new Label(stylesComposite, SWT.LEFT);
	fColorEditorLabel.setText("Color:");
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalIndent = 20;
	fColorEditorLabel.setLayoutData(gd);
	
	fSyntaxForegroundColorEditor = new ColorSelector(stylesComposite);
	fForegroundColorButton = fSyntaxForegroundColorEditor.getButton();
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	fForegroundColorButton.setLayoutData(gd);
	
	fBoldCheckBox = new Button(stylesComposite, SWT.CHECK);
	fBoldCheckBox.setText("Bold");
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalIndent = 20;
	gd.horizontalSpan = 2;
	fBoldCheckBox.setLayoutData(gd);
	
	fItalicCheckBox = new Button(stylesComposite, SWT.CHECK);
	fItalicCheckBox.setText("Italic");
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalIndent = 20;
	gd.horizontalSpan = 2;
	fItalicCheckBox.setLayoutData(gd);
	
	fStrikethroughCheckBox = new Button(stylesComposite, SWT.CHECK);
	fStrikethroughCheckBox.setText("Strikethrough");
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalIndent = 20;
	gd.horizontalSpan = 2;
	fStrikethroughCheckBox.setLayoutData(gd);
	
	fUnderlineCheckBox = new Button(stylesComposite, SWT.CHECK);
	fUnderlineCheckBox.setText("Underlined");
	gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
	gd.horizontalIndent = 20;
	gd.horizontalSpan = 2;
	fUnderlineCheckBox.setLayoutData(gd);
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:58,代码来源:DwprofileSyntaxColoringPreferencePage.java

示例3: makeColorControl

import org.eclipse.jface.preference.ColorSelector; //导入方法依赖的package包/类
public static Button makeColorControl(Composite options, int span) {
	ColorSelector selector = new ColorSelector(options);
	Button button = selector.getButton();
	GridDataFactory.fillDefaults().span(span, 1).applyTo(button);
	return button;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:7,代码来源:SwtUtil.java

示例4: ColourControl

import org.eclipse.jface.preference.ColorSelector; //导入方法依赖的package包/类
/**
 * Creates the control in the specified composite. Adds the preferences to
 * the list of styles to edit.
 * @param parent The parent composite to put this control in
 * @param preferences The preferences this control will edit.
 */
public ColourControl( Composite parent, Preference ... preferences )
{
   composite = SWTUtil.createGridLayoutComposite( parent, 2 );
   SWTUtil.removeLayoutMargins( (GridLayout) composite.getLayout() );
   
   SWTUtil.gridDataFillHorizontal( composite );
   
   // List of colour preferences
   SWTUtil.addLabel( composite, ZLang.ZL_ElementLabel );
   SWTUtil.createBlankGrid( composite );
   
   elementList = SWTUtil.addList( composite, SWT.V_SCROLL );
   SWTUtil.gridDataPreferredHeight( elementList, 180 );
   elementList.addSelectionListener( colourListener );
   
   for( Preference pref : preferences ) {
      elementList.add( pref.getText() );
      ColourSetting setting = new ColourSetting( pref );
      colourSettings.add( setting );
      prefMap.put( pref, setting );
   }
   elementList.setSelection( 0 );
   SWTUtil.gridDataFillHorizontal( elementList );
   
   // Colour options
   Composite colourOptions = SWTUtil.createGridLayoutComposite( composite, 2 );
   
   checkDefault = SWTUtil.addCheckButton( colourOptions, ZLang.ZL_UseDefault, true );
   SWTUtil.gridDataColSpan( checkDefault, 2 );
   checkDefault.addSelectionListener( colourListener );
   
   SWTUtil.createBlankGrid( colourOptions, 10, 1 );
   Composite colourComposite = SWTUtil.createGridLayoutComposite( colourOptions, 2 );
   SWTUtil.removeLayoutMargins( (GridLayout) colourComposite.getLayout() );
   Label colourButtonLabel = SWTUtil.addLabel( colourComposite, ZLang.ZL_ColourLabel );
   buttonColour = new ColorSelector( colourComposite );
   buttonColour.addListener( colourListener );
   
   SWTUtil.createBlankGrid( colourOptions, 10, 1 );
   checkBold = SWTUtil.addCheckButton( colourOptions, ZLang.ZL_Bold, false );
   checkBold.addSelectionListener( colourListener );
   
   SWTUtil.createBlankGrid( colourOptions, 10, 1 );
   checkItalic = SWTUtil.addCheckButton( colourOptions, ZLang.ZL_Italic, false );
   checkItalic.addSelectionListener( colourListener );
   
   SWTUtil.createBlankGrid( colourOptions, 10, 1 );
   checkStrikethrough = SWTUtil.addCheckButton( colourOptions, ZLang.ZL_Strikethrough, false );
   checkStrikethrough.addSelectionListener( colourListener );
   
   SWTUtil.createBlankGrid( colourOptions, 10, 1 );
   checkUnderline = SWTUtil.addCheckButton( colourOptions, ZLang.ZL_Underline, false );
   checkUnderline.addSelectionListener( colourListener );
   
   settingSet = new SWTSet( 
      buttonColour.getButton(), checkBold, checkItalic, checkStrikethrough, 
      checkUnderline, colourButtonLabel
   );
   
   // Preview
   Label previewLabel = SWTUtil.addLabel( composite, ZLang.ZL_PreviewLabel );
   SWTUtil.gridDataColSpan( previewLabel, 2 );
   
   preview = new TrafficScriptPreview( composite );
        
   colourListener.showSelectedProperty();
   
   composite.pack();
   composite.layout();      
}
 
开发者ID:brocade,项目名称:vTM-eclipse,代码行数:77,代码来源:ColourControl.java


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