當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。