本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
});
}
示例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);
}
}
示例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;
}