當前位置: 首頁>>代碼示例>>Java>>正文


Java Text.setForeground方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Text.setForeground方法的典型用法代碼示例。如果您正苦於以下問題:Java Text.setForeground方法的具體用法?Java Text.setForeground怎麽用?Java Text.setForeground使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Text的用法示例。


在下文中一共展示了Text.setForeground方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addHeader

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
public Composite addHeader(){
	Composite composite = new Composite(container, SWT.NONE);
	GridLayout gl_composite = new GridLayout(textGridRow.getNumberOfColumn() + 1, false);
	gl_composite.horizontalSpacing = 7;
	gl_composite.marginWidth = 1;
	gl_composite.marginHeight = 0;
	gl_composite.verticalSpacing = 1;
	composite.setLayout(gl_composite);
		
	Button rowSelection = new Button(composite, SWT.CHECK);
	
	Map<Integer, TextGridColumnLayout> columns = textGridRow.getTextGridColumns();
	for(int columnNumber:columns.keySet()){
		Text text = new Text(composite, SWT.BORDER);
		if(!columns.get(columnNumber).grabHorizantalAccessSpace()){
			GridData gd_text = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
			gd_text.widthHint = columns.get(columnNumber).getColumnWidth();
			text.setLayoutData(gd_text);
			
			text.setEditable(false);
			text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
			text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));
		}else{
			text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
			text.setBounds(0, 0, 76, 21);
			text.setFocus();
			
			text.setEditable(false);
			text.setForeground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
			text.setBackground(SWTResourceManager.getColor(SWT.COLOR_LIST_SELECTION));				
		}
		

		if(rowData!=null)
			text.setText(rowData.get(columnNumber));
	}
	
	return composite;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:40,代碼來源:TextGridRowBuilder.java

示例2: createSearchTextBox

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
private void createSearchTextBox(Composite headerComposite) {
	functionSearchTextBox = new Text(headerComposite, SWT.BORDER);
	GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
	gd_searchTextBox.widthHint = 150;
	functionSearchTextBox.setLayoutData(gd_searchTextBox);
	functionSearchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128, 128, 128));
	functionSearchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	functionSearchTextBox.setEnabled(false);
	addListnersToSearchTextBox();
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(functionSearchTextBox);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:12,代碼來源:FunctionsUpperComposite.java

示例3: createSearchTextBox

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
private void createSearchTextBox(Composite headerComposite) {
	searchTextBox = new Text(headerComposite, SWT.BORDER);
	GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
	gd_searchTextBox.widthHint = 191;
	searchTextBox.setLayoutData(gd_searchTextBox);
	searchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128,128,128));
	searchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	addListnersToSearchTextBox();
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(searchTextBox);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:11,代碼來源:AvailableFieldsComposite.java

示例4: createSearchTextBox

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
private void createSearchTextBox(Composite headerComposite) {
	searchTextBox = new Text(headerComposite, SWT.BORDER);
	GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, false, true, 0, 0);
	gd_searchTextBox.widthHint = 150;
	searchTextBox.setLayoutData(gd_searchTextBox);
	searchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry(128,128,128));
	searchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	addListnersToSearchTextBox();
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(searchTextBox);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:11,代碼來源:CategoriesUpperComposite.java

示例5: createSearchTextBox

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
private void createSearchTextBox(Composite fieldTableComposite) {
	searchTextBox = new Text(fieldTableComposite, SWT.BORDER);
	searchTextBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	searchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128,128,128));
	searchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(searchTextBox);
	searchTextBox.addModifyListener(new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			evalDialogFieldTable.getTableViewer().resetFilters();
			if(!StringUtils.equals(Constants.DEFAULT_SEARCH_TEXT, searchTextBox.getText())){
				ViewerFilter filter=new ViewerFilter() {
					@Override
					public boolean select(Viewer viewer, Object parentElement, Object element) {
						if(element!=null && element instanceof FieldNameAndValue){
							FieldNameAndValue fieldNameAndValue=(FieldNameAndValue) element;
							if(StringUtils.containsIgnoreCase(fieldNameAndValue.getFieldName(),searchTextBox.getText()) ){
								return true;
							}
						}
						return false;
					}
				};
				ViewerFilter[] filters={filter};
				evalDialogFieldTable.getTableViewer().setFilters(filters);
			}
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:31,代碼來源:EvaluateDialog.java

示例6: addMouseMoveListener

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
/**
 * 
 * Add MouseMoveListner 
 * @param extSchemaPathText
 * @param cursor
 */
public void addMouseMoveListener(Text extSchemaPathText , Cursor cursor){
 if(ParameterUtil.containsParameter(extSchemaPathText.getText(),'/')||ParameterUtil.containsParameter(extSchemaPathText.getText(),'\\')){
		extSchemaPathText.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0, 0, 255));	
		extSchemaPathText.setCursor(cursor);
		extSchemaPathText.addMouseMoveListener(getMouseListner(extSchemaPathText));
			}
	else{
		extSchemaPathText.removeMouseMoveListener(getMouseListner(extSchemaPathText));
		extSchemaPathText.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 0, 0, 0));
		extSchemaPathText.setCursor(null);
	}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:19,代碼來源:Utils.java

示例7: createDialogArea

import org.eclipse.swt.widgets.Text; //導入方法依賴的package包/類
private Control createDialogArea(Composite shell) {
       GridLayout layout = new GridLayout();
	layout.numColumns = 1;
	shell.setLayout(layout);

	lblStep = new Label(shell, SWT.NONE);
	lblStep.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	lblStep.setText("Step 1 / 999");

	lblMessage = new Label(shell, SWT.NONE);
	lblMessage.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	lblMessage.setText("Idle");

	pbProg = new ProgressBar(shell, SWT.SMOOTH | SWT.INDETERMINATE);
	pbProg.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
	pbProg.setMaximum(1000);
	pbProg.setSelection(0);
	pbProg.setSelection(256);

	final Label lblSeparator = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
	lblSeparator.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));

	txtLog = new Text(shell, SWT.MULTI
	          | SWT.BORDER
	          | SWT.H_SCROLL
	          | SWT.V_SCROLL);
	txtLog.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
	txtLog.setEditable(false);
	txtLog.setBackground(new Color(shell.getDisplay(), 10,10,10));
	txtLog.setForeground(new Color(shell.getDisplay(), 200,200,200));

	shell.layout();

	return shell;
}
 
開發者ID:aserg-ufmg,項目名稱:RefDiff,代碼行數:36,代碼來源:ProgressBarDialog.java


注:本文中的org.eclipse.swt.widgets.Text.setForeground方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。