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


Java Text.setFont方法代码示例

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


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

示例1: initialize

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void initialize() {
	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 1;
	GridData gridData = new org.eclipse.swt.layout.GridData();
	gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData.grabExcessVerticalSpace = true;
	gridData.grabExcessHorizontalSpace = true;
	gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
	
	//minimum size (when dialog open)
	gridData.minimumHeight = 200;
	gridData.minimumWidth = 300;
	
	this.setLayout(gridLayout);
	textArea = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
	textArea.setFont(new Font(null,"Tahoma",10,0));
	textArea.setLayoutData(gridData);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:TextEditorComposite.java

示例2: initialize

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private void initialize() {
	labelSyntaxe = new Label(this, SWT.NONE);
	
	labelSyntaxe.setText("SQL query syntax examples :\n");
	labelSyntaxe.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
	labelSQLQuery = new Label(this, SWT.NONE);
	labelSQLQuery.setFont(new Font(null,"Tahoma",8,1));
	labelSQLQuery.setText("SELECT * FROM EMPLOYEES WHERE (NAME='{parameter_name}')\n"
							+ "{? = CALL STORED_FUNCTION({parameter_name})}\n"
							+ "{CALL STORED_PROCEDURE({parameter_name})}\n\n");
	labelSQLQuery.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false));
	textAreaSQLQuery = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
	textAreaSQLQuery.setFont(new Font(null,"Tahoma",10,0));
	textAreaSQLQuery.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
	GridLayout gridLayout = new GridLayout();
	this.setLayout(gridLayout);
	setSize(new org.eclipse.swt.graphics.Point(402,289));
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:SqlQueryEditorComposite.java

示例3: createControl

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NULL);
	GridLayout gridLayout = new GridLayout();
	gridLayout.verticalSpacing = 10;
	container.setLayout(gridLayout);
	
	Label label = new Label(container, SWT.NONE);
	label.setText("Please enter the Convertigo api path of the mapping\n");
	
	mappingPath = new Text(container, SWT.BORDER | SWT.SINGLE);
	mappingPath.setFont(new Font(container.getDisplay(), "Tahoma", 10, 0));
	mappingPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	mappingPath.setText("/");
	mappingPath.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			dialogChanged();
		}
	});
	
	setControl(container);
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:UrlMappingWizardPage.java

示例4: createDialogArea

import org.eclipse.swt.widgets.Text; //导入方法依赖的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

示例5: updateScaledFont

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
 * update scaledFonts
 * @param zoom
 * 				at zoom 
 */
private void updateScaledFont(double zoom) {
	if (cachedZoom == zoom)
		return;
	
	Text text = (Text)getCellEditor().getControl();
	Font font = getEditPart().getFigure().getFont();
	
	disposeScaledFont();
	cachedZoom = zoom;
	if (zoom == 1.0)
		text.setFont(font);
	else {
		FontData fd = font.getFontData()[0];
		fd.setHeight((int)(fd.getHeight() * zoom));
		text.setFont(scaledFont = new Font(null, fd));
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:23,代码来源:CommentBoxLabelEditManager.java

示例6: createLanguageLayout

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/***
 * Create the Field where user enters the language used to execute
 * 
 * @param parent container composite
 * @param font used font
 * @return the created composite containing the fields
 */
public Composite createLanguageLayout(Composite parent, Font font) {
	// Language
	createTextLabelLayout(parent, "Melange languages");
	_languageCombo = new Combo(parent, SWT.NONE);
	_languageCombo.setLayoutData(createStandardLayout());

	List<String> languagesNames = MelangeHelper.getAllLanguages();
	String[] empty = {};
	_languageCombo.setItems(languagesNames.toArray(empty));
	_languageCombo.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			//String selection = _languageCombo.getText();
			//List<String> modelTypeNames = MelangeHelper.getModelTypes(selection);
			updateLaunchConfigurationDialog();
		}
	});
	createTextLabelLayout(parent, "");

	createTextLabelLayout(parent, "Melange resource adapter query");
	_melangeQueryText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	_melangeQueryText.setLayoutData(createStandardLayout());
	_melangeQueryText.setFont(font);
	_melangeQueryText.setEditable(false);
	createTextLabelLayout(parent, "");
	
	return parent;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:36,代码来源:LaunchConfigurationMainTab.java

示例7: createControl

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
@Override
public void createControl(Composite parent) {
       // project specification group
       Composite composite = new Composite(parent, SWT.NONE);
       GridLayout layout = new GridLayout();
       layout.numColumns = 2;
       composite.setLayout(layout);
       composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

       // new project label
       Label label = new Label(composite, SWT.NONE);
       label.setText("Language name");
       label.setFont(parent.getFont());

       // new project name entry field
       _nameField = new Text(composite, SWT.BORDER);
       GridData data = new GridData(GridData.FILL_HORIZONTAL);
       data.widthHint = SIZING_TEXT_FIELD_WIDTH;
       _nameField.setLayoutData(data);
       _nameField.setFont(parent.getFont());

       // Set the initial value first before listener
       // to avoid handling an event during the creation.
       if (_initialLanguageName != null) {
		_nameField.setText(_initialLanguageName);
	}
       _nameField.addListener(SWT.Modify, nameModifyListener);
       BidiUtils.applyBidiProcessing(_nameField, BidiUtils.BTD_DEFAULT);	
       setControl(composite);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:31,代码来源:AskLanguageNameWizardPage.java

示例8: initialize

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
protected void initialize() {
	GridData gridData = new org.eclipse.swt.layout.GridData();
	gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
	cicsData = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
	cicsData.setEditable(false);
	cicsData.setBackground(new Color(null,253,253,244));
	cicsData.setFont(new Font(null,"Courier New",10,1));
	cicsData.setLayoutData(gridData);
	cicsData.setText("");
	this.setLayout(new GridLayout());
	setSize(new Point(300, 200));
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:16,代码来源:CicsConnectorComposite.java

示例9: createModelLayout

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/***
 * Create the Fields where user enters model to execute
 * 
 * @param parent container composite
 * @param font used font
 * @return the created composite containing the fields
 */
public Composite createModelLayout(Composite parent, Font font) {
	createTextLabelLayout(parent, "Model to execute");
	// Model location text
	_modelLocationText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	_modelLocationText.setLayoutData(createStandardLayout());
	_modelLocationText.setFont(font);
	_modelLocationText.addModifyListener(fBasicModifyListener);
	Button modelLocationButton = createPushButton(parent, "Browse", null);
	modelLocationButton.addSelectionListener(new SelectionAdapter() {

		public void widgetSelected(SelectionEvent evt) {
			// handleModelLocationButtonSelected();
			// TODO launch the appropriate selector

			SelectAnyIFileDialog dialog = new SelectAnyIFileDialog();
			if (dialog.open() == Dialog.OK) {
				String modelPath = ((IResource) dialog.getResult()[0])
						.getFullPath().toPortableString();
				_modelLocationText.setText(modelPath);
				updateLaunchConfigurationDialog();
				_modelProject = ((IResource) dialog.getResult()[0]).getProject();
			}
		}
	});
	createTextLabelLayout(parent, "Model initialization method");
	_modelInitializationMethodText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	_modelInitializationMethodText.setLayoutData(createStandardLayout());
	_modelInitializationMethodText.setFont(font);
	_modelInitializationMethodText.setEditable(false);
	createTextLabelLayout(parent, "");
	createTextLabelLayout(parent, "Model initialization arguments");
	_modelInitializationArgumentsText = new Text(parent, SWT.MULTI | SWT.BORDER |  SWT.WRAP | SWT.V_SCROLL);
	_modelInitializationArgumentsText.setToolTipText("one argument per line");
	GridData gridData = new GridData(GridData.FILL_BOTH);
	gridData.heightHint = 40;
	_modelInitializationArgumentsText.setLayoutData(gridData);
	//_modelInitializationArgumentsText.setLayoutData(createStandardLayout());
	_modelInitializationArgumentsText.setFont(font);
	_modelInitializationArgumentsText.setEditable(true);
	_modelInitializationArgumentsText.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			updateLaunchConfigurationDialog();
		}
	});
	createTextLabelLayout(parent, "");
	
	return parent;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:57,代码来源:LaunchConfigurationMainTab.java

示例10: createAnimationLayout

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
private Composite createAnimationLayout(Composite parent, Font font) {
	createTextLabelLayout(parent, "Animator");

	_siriusRepresentationLocationText = new Text(parent, SWT.SINGLE
			| SWT.BORDER);
	_siriusRepresentationLocationText.setLayoutData(createStandardLayout());
	_siriusRepresentationLocationText.setFont(font);
	_siriusRepresentationLocationText
			.addModifyListener(fBasicModifyListener);
	Button siriusRepresentationLocationButton = createPushButton(parent,
			"Browse", null);
	siriusRepresentationLocationButton
			.addSelectionListener(new SelectionAdapter() {
				public void widgetSelected(SelectionEvent evt) {
					// handleModelLocationButtonSelected();
					// TODO launch the appropriate selector

					SelectAIRDIFileDialog dialog = new SelectAIRDIFileDialog();
					if (dialog.open() == Dialog.OK) {
						String modelPath = ((IResource) dialog.getResult()[0])
								.getFullPath().toPortableString();
						_siriusRepresentationLocationText
								.setText(modelPath);
						updateLaunchConfigurationDialog();
					}
				}
			});

	createTextLabelLayout(parent, "Delay");
	_delayText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	_delayText.setLayoutData(createStandardLayout());
	_delayText.addModifyListener(new ModifyListener() {

		@Override
		public void modifyText(ModifyEvent e) {
			updateLaunchConfigurationDialog();
		}
	});
	createTextLabelLayout(parent, "(in milliseconds)");

	new Label(parent, SWT.NONE).setText("");
	_animationFirstBreak = new Button(parent, SWT.CHECK);
	_animationFirstBreak.setText("Break at start");
	_animationFirstBreak.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent event) {
			updateLaunchConfigurationDialog();
		}
	}

	);

	return parent;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:56,代码来源:LaunchConfigurationMainTab.java

示例11: createTextContents

import org.eclipse.swt.widgets.Text; //导入方法依赖的package包/类
/**
    * Creates the controls used to show the value of this cell area.
    * <p>
    * The default implementation of this framework method creates
    * a label widget, using the same font and background color as the parent control.
    * </p>
    * <p>
    * Subclasses may reimplement.  If you reimplement this method, you
    * should also reimplement <code>updateContents</code>.
    * </p>
    *
    * @param cell the control for this cell area
    * @return the underlying control
    */
   protected Control createTextContents(Composite cell) {
Text txt = new Text(cell, SWT.LEFT);
txt.setFont(cell.getFont());
txt.setBackground(cell.getBackground());
txt.setEditable(false);
GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
gData.widthHint = 100;
txt.setLayoutData(gData);
defaultLabel = txt;
       return txt;
   }
 
开发者ID:eclipse,项目名称:scanning,代码行数:26,代码来源:ModelCellEditor.java


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