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


Java PixelConverter类代码示例

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


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

示例1: createDialogArea

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
    Composite comp = (Composite) super.createDialogArea(parent);
    Text filed = new Text(comp, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
            | SWT.READ_ONLY | SWT.MULTI);
    filed.setText(text);
    filed.setBackground(getShell().getDisplay().getSystemColor(
            SWT.COLOR_LIST_BACKGROUND));
    filed.setFont(JFaceResources.getTextFont());
    PixelConverter pc = new PixelConverter(filed);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = pc.convertWidthInCharsToPixels(80);
    gd.heightHint = pc.convertHeightInCharsToPixels(30);
    filed.setLayoutData(gd);
    return comp;
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:17,代码来源:SQLEditor.java

示例2: createColumn

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
@Override
public TreeColumnDefinition createColumn(	final ColumnManager columnManager,
											final PixelConverter pixelConverter) {

	final TreeColumnDefinition colDef = new TreeColumnDefinition(
			columnManager,
			"TIME_PAUSED_TIME_RELATIVE", //$NON-NLS-1$
			SWT.TRAIL);

	colDef.setColumnCategory(Messages.ColumnFactory_Category_Time);
	colDef.setColumnLabel(Messages.ColumnFactory_paused_time_relative_label);
	colDef.setColumnHeaderText(Messages.ColumnFactory_paused_relative_time);
	colDef.setColumnUnit(Messages.ColumnFactory_paused_relative_time);
	colDef.setColumnHeaderToolTipText(Messages.ColumnFactory_paused_time_relative_tooltip);

	colDef.setDefaultColumnWidth(pixelConverter.convertWidthInCharsToPixels(10));

	return colDef;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:20,代码来源:TreeColumnFactory.java

示例3: createColumn

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
@Override
public TableColumnDefinition createColumn(	final ColumnManager columnManager,
											final PixelConverter pixelConverter) {

	final TableColumnDefinition colDef = new TableColumnDefinition(columnManager, "TIME_TOUR_START_DATE", //$NON-NLS-1$
			SWT.TRAIL);

	colDef.setColumnCategory(Messages.ColumnFactory_Category_Time);
	colDef.setColumnLabel(Messages.ColumnFactory_TourStartDate_Label);
	colDef.setColumnHeaderText(Messages.ColumnFactory_TourStartDate_Header);
	colDef.setColumnHeaderToolTipText(Messages.ColumnFactory_TourStartDate_Tooltip);

	colDef.setDefaultColumnWidth(pixelConverter.convertWidthInCharsToPixels(14));

	return colDef;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:17,代码来源:TableColumnFactory.java

示例4: CooperateProjectImportComposite

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
/**
 * Constructor, creates a CheckboxTableViewer and selection buttons.
 * 
 * @param parent
 *            The parent composite.
 * @param style
 *            Style which will be used.
 * @param page
 *            Page which uses this composite.
 */
public CooperateProjectImportComposite(Composite parent, int style, ImportWizardPage page) {
    super(parent, style);
    Composite tableComposite = new Composite(this, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginWidth = 0;
    layout.makeColumnsEqualWidth = false;
    tableComposite.setLayout(layout);

    tableComposite
            .setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH));

    tv = CheckboxTableViewer.newCheckList(tableComposite, style | SWT.BORDER);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gridData.widthHint = new PixelConverter(tv.getControl()).convertWidthInCharsToPixels(25);
    gridData.heightHint = new PixelConverter(tv.getControl()).convertHeightInCharsToPixels(10);
    tv.getControl().setLayoutData(gridData);
    setLayout(layout);
    tv.addSelectionChangedListener(event -> selectionChanged(page));
    addSelectionButtons(page);
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:32,代码来源:CooperateProjectImportComposite.java

示例5: createPartControl

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
@Override
	public void createPartControl(final Composite parent) {

		_pc = new PixelConverter(parent);

		// define all columns for the viewer
		_columnManager = new ColumnManager(this, _state);
//		_columnManager.setIsCategoryAvailable(true);
		defineAllColumns(parent);

		createUI(parent);

		addPartListeners();
		addSelectionListeners();
		addCompareTourPropertyListener();
		addPrefListener();
		addTourEventListener();

		createActions();
		fillViewMenu();

		getSite().setSelectionProvider(_postSelectionProvider = new PostSelectionProvider(ID));

		_tourViewer.setInput(_rootItem = new TVICompareResultRootItem());
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:TourCompareResultView.java

示例6: createSpinner

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
/**
 * @param parent
 * @param min
 * @param max
 * @param hspan
 * @param style
 * @return
 */
public static Spinner createSpinner(Composite parent, int min, int max, int hspan, int style)
{
	Spinner spinner = new Spinner(parent, SWT.BORDER | style);
	spinner.setMinimum(min);
	spinner.setMaximum(max);

	GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false, hspan, 1);
	PixelConverter pc = new PixelConverter(spinner);
	// See http://jira.appcelerator.org/browse/APSTUD-3215
	// We need to add some extra spacing to the MacOSX spinner in order to adjust the size to the way Mac draws
	// spinners.
	int extraWidth = Platform.OS_MACOSX.equals(Platform.getOS()) ? 25 : 0;
	gd.widthHint = pc.convertWidthInCharsToPixels(2) + extraWidth;
	spinner.setLayoutData(gd);
	return spinner;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:25,代码来源:SWTFactory.java

示例7: initUI

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
private void initUI(final Composite parent) {

		_pc = new PixelConverter(parent);
		_hintDefaultSpinnerWidth = _isLinux ? SWT.DEFAULT : _pc.convertWidthInCharsToPixels(_isOSX ? 10 : 5);

		_selectionListener = new SelectionAdapter() {
			@Override
			public void widgetSelected(final SelectionEvent e) {
				if (_isUpdateUI) {
					return;
				}
				onModifySmoothing(e.widget, true);
			}
		};

		_spinnerMouseWheelListener = new MouseWheelListener() {
			@Override
			public void mouseScrolled(final MouseEvent event) {
				Util.adjustSpinnerValueOnMouseScroll(event);
				if (_isUpdateUI) {
					return;
				}
				onModifySmoothing(event.widget, true);
			}
		};
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:27,代码来源:SmoothingUI_Jamet.java

示例8: createUITextarea

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
private void createUITextarea(	final Composite parent,
								final String labelText,
								final String areaText,
								final PixelConverter pc) {
	Label label;
	final int horizontalHint = areaText.length() > 80 ? pc.convertWidthInCharsToPixels(80) : SWT.DEFAULT;

	label = createUILabel(parent, labelText);
	GridDataFactory.fillDefaults()//
			.align(SWT.FILL, SWT.BEGINNING)
			.applyTo(label);

	label = new Label(parent, SWT.WRAP);
	GridDataFactory.fillDefaults()//
			.hint(horizontalHint, SWT.DEFAULT)
			.applyTo(label);

	label.setForeground(_fgColor);
	label.setBackground(_bgColor);
	label.setText(areaText);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:22,代码来源:WayPointToolTipProvider.java

示例9: createUI

import org.eclipse.jface.layout.PixelConverter; //导入依赖的package包/类
private void createUI(final Composite parent) {

		_pc = new PixelConverter(parent);

		_uiContainer = new Composite(parent, SWT.NONE);
		GridDataFactory.fillDefaults().grab(true, true).applyTo(_uiContainer);
		GridLayoutFactory.swtDefaults().numColumns(2).margins(0, 0).applyTo(_uiContainer);
		{
			createUI_10_Profile(_uiContainer);
			createUI_12_ProfileViewer(_uiContainer);
			createUI_14_ProfileActions(_uiContainer);

			createUI_70_ColumnsHeader(_uiContainer);
			createUI_72_ColumnsViewer(_uiContainer);
			createUI_74_ColumnActions(_uiContainer);
			createUI_76_Hints(_uiContainer);

			createUI_80_ColumnAnnotations(_uiContainer);
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:21,代码来源:DialogModifyColumns.java


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