本文整理汇总了Java中org.eclipse.jface.fieldassist.ControlDecoration.hide方法的典型用法代码示例。如果您正苦于以下问题:Java ControlDecoration.hide方法的具体用法?Java ControlDecoration.hide怎么用?Java ControlDecoration.hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.fieldassist.ControlDecoration
的用法示例。
在下文中一共展示了ControlDecoration.hide方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getListener
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar,ListenerHelper helpers, Widget... widgets) {
final Widget[] widgetList = widgets;
Listener listener=new Listener() {
@Override
public void handleEvent(Event event) {
if(!((Button)widgetList[1]).getSelection()){
ControlDecoration fieldNameMustJava = WidgetUtility.addDecorator((Text)widgetList[0],Messages.INVALID_FILE);
if(!WidgetUtility.isFileExtention((((Text)widgetList[0]).getText()).trim(), ".java") && !(((Text)widgetList[0]).getText().trim().isEmpty())){
fieldNameMustJava.show();
((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
255, 204));
}
else
{
((Text)widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255,
255, 255));
fieldNameMustJava.hide();
}
}
}
};
return listener;
}
示例2: validate
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void validate(Text text1, Text text2,
ControlDecoration text1Decorator, ControlDecoration text2Decorator, String lowerValue, String upperValue) {
if(validateNumericField(text1.getText())){
text1Decorator.hide();
if(StringUtils.isNotBlank(text2.getText()) && validateNumericField(text2.getText())){
if(compareBigIntegerValue(upperValue, lowerValue) == -1){
text1Decorator.show();
text1Decorator.setDescriptionText(Messages.UPPER_LOWER_BOUND_ERROR);
}else{
text1Decorator.hide();
text2Decorator.hide();
}
}
}
else{
text1Decorator.show();
text1.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
text1Decorator.setDescriptionText(Messages.DB_NUMERIC_PARAMETERZIATION_ERROR);
validateFieldWithParameter(text1.getText(), text1Decorator);
validateFieldWithParameter(text2.getText(), text2Decorator);
}
}
示例3: getListener
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(final PropertyDialogButtonBar propertyDialogButtonBar,
ListenerHelper helpers, final Widget... widgets) {
final Button button = ((Button)widgets[0]);
button.getShell();
if(helpers != null){
txtDecorator = (ControlDecoration) helpers.get(HelperType.CONTROL_DECORATION);
file_extension=(String)helpers.get(HelperType.FILE_EXTENSION);
}
Listener listener=new Listener() {
@Override
public void handleEvent(Event event) {
if(event.type==SWT.Selection){
FilterOperationClassUtility.INSTANCE.browseFile(file_extension,((Text) widgets[0]));
propertyDialogButtonBar.enableApplyButton(true);
txtDecorator.hide();
}
}
};
return listener;
}
示例4: isTextBoxEmpty
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void isTextBoxEmpty(ModifyEvent e, ControlDecoration emptyDecorator,ControlDecoration zeroDecorator) {
emptyDecorator.hide();
zeroDecorator.hide();
String fileSize = ((Text) e.widget).getText();
if (!fileSize.isEmpty()) {
emptyDecorator.hide();
if (Integer.parseInt(fileSize) == 0) {
zeroDecorator.show();
getButton(0).setEnabled(false);
} else {
zeroDecorator.hide();
getButton(0).setEnabled(true);
}
enableAndDisableOkButtonIfAnyDecoratorIsVisible();
} else {
getButton(0).setEnabled(false);
emptyDecorator.show();
}
}
示例5: getListener
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper,
Widget... widgets) {
if (helper != null) {
txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
}
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
String string = event.text;
Matcher matchs = Pattern.compile(Constants.REGEX).matcher(string);
LOGGER.debug("Verifying text format");
if (!matchs.matches()) {
txtDecorator.setDescriptionText(Messages.CHARACTERSET);
txtDecorator.show();
event.doit = false;
} else
txtDecorator.hide();
}
};
return listener;
}
示例6: getListener
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public Listener getListener(PropertyDialogButtonBar propertyDialogButtonBar, ListenerHelper helper, Widget... widgets) {
final Widget[] widgetList = widgets;
if (helper != null){
txtDecorator = (ControlDecoration) helper.get(HelperType.CONTROL_DECORATION);
}
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
String charSet = ((Text) widgetList[0]).getText();
if(SWT.FocusIn == event.type) {
if (StringUtils.isEmpty(charSet)) {
txtDecorator.show();
((Text) widgetList[0]).setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 255, 255, 255));
((Text) widgetList[0]).setToolTipText(txtDecorator.getDescriptionText());
} else {
txtDecorator.hide();
}
}
}
};
return listener;
}
示例7: createControl
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
@Override
public void createControl(UI_POSITION position, Composite parent) {
// We add controls only to the BOTTOM position.
if (position == UI_POSITION.BOTTOM) {
portLabel = new Label(parent, SWT.NONE);
portLabel.setVisible(false);
portLabel.setText(Messages.getString("NEW_SERVER_DIALOG_PORT"));
portText = new Text(parent, SWT.SINGLE | SWT.BORDER);
portText.setVisible(false);
portText.setText(String.valueOf(LocalAppEngineServerBehaviour.DEFAULT_SERVER_PORT));
portText.addVerifyListener(new PortChangeMonitor());
portText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
Image errorImage = registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
portDecoration = new ControlDecoration(portText, SWT.LEFT | SWT.TOP);
portDecoration.setDescriptionText(Messages.getString("NEW_SERVER_DIALOG_INVALID_PORT_VALUE"));
portDecoration.setImage(errorImage);
portDecoration.hide();
}
}
示例8: createControlDecoration
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
/**
* creates a control decoration to given control. will add the control to
* decorations map
*
* @param control
* to add decoration to
* @param message
* to display when decoration is shown
* @param isRequired
* should the required asterisk be shown?
* @return created decoration
*/
public static ControlDecoration createControlDecoration(final Control control, final String message,
final boolean isRequired) {
final ControlDecoration controlDecoration = new ControlDecoration(control, SWT.RIGHT | SWT.BOTTOM);
final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
decorations.put(control, controlDecoration);
controlDecoration.setImage(fieldDecoration.getImage());
controlDecoration.hide();
control.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent e) {
final ControlDecoration remove = decorations.remove(control);
controlDecoration.dispose();
}
});
if (isRequired) {
createRequiredControlDecoration(control);
}
return controlDecoration;
}
示例9: updateDecoration
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
protected void updateDecoration(ControlDecoration decoration, RefactoringStatus status) {
RefactoringStatusEntry highestSeverity= status.getEntryWithHighestSeverity();
if (highestSeverity != null) {
Image newImage= null;
FieldDecorationRegistry registry= FieldDecorationRegistry.getDefault();
switch (highestSeverity.getSeverity()) {
case RefactoringStatus.INFO:
newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage();
break;
case RefactoringStatus.WARNING:
newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage();
break;
case RefactoringStatus.FATAL:
case RefactoringStatus.ERROR:
newImage= registry.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage();
}
decoration.setDescriptionText(highestSeverity.getMessage());
decoration.setImage(newImage);
decoration.show();
} else {
decoration.setDescriptionText(null);
decoration.hide();
}
}
示例10: requestVerification
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
public void requestVerification() {
boolean verified = true;
for (IGenericTransactionField field : transaction.getFields()) {
String[] message = new String[1];
ControlDecoration deco = decorators.get(field.getLabel());
if (field.verify(message)) {
deco.hide();
}
else {
deco.setDescriptionText(message[0]);
deco.show();
verified = false;
}
}
createPage._canFlipToNextPage = verified;
try {
getContainer().updateButtons();
}
catch (Exception e) {}
}
示例11: showErrorDecoration
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showErrorDecoration( AssistField smartField, boolean show )
{
FieldDecoration dec = smartField.getErrorDecoration( );
ControlDecoration cd = smartField.controlDecoration;
if ( show )
{
cd.setImage( dec.getImage( ) );
cd.setDescriptionText( dec.getDescription( ) );
cd.setShowOnlyOnFocus( false );
cd.show( );
}
else
{
cd.hide( );
}
}
示例12: showWarningDecoration
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showWarningDecoration( AssistField smartField, boolean show )
{
FieldDecoration dec = smartField.getWarningDecoration( );
ControlDecoration cd = smartField.controlDecoration;
if ( show )
{
cd.setImage( dec.getImage( ) );
cd.setDescriptionText( dec.getDescription( ) );
cd.setShowOnlyOnFocus( false );
cd.show( );
}
else
{
cd.hide( );
}
}
示例13: showContentAssistDecoration
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void showContentAssistDecoration( AssistField smartField,
boolean show )
{
FieldDecoration dec = getCueDecoration( );
ControlDecoration cd = smartField.controlDecoration;
if ( show )
{
cd.setImage( dec.getImage( ) );
cd.setDescriptionText( dec.getDescription( ) );
cd.setShowOnlyOnFocus( true );
cd.show( );
}
else
{
cd.hide( );
}
}
示例14: initDecorators
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void initDecorators() {
FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
.getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
cbProjectDecoration = new ControlDecoration(cbProject, SWT.TOP | SWT.RIGHT);
cbProjectDecoration.setImage(fieldDecoration.getImage());
cbProjectDecoration.setDescriptionText("Please first create a Maven project");
cbProjectDecoration.hide();
cbVersionDecoration = new ControlDecoration(cbVersion, SWT.TOP | SWT.RIGHT);
cbVersionDecoration.setImage(fieldDecoration.getImage());
cbVersionDecoration.setDescriptionText(
"Please first add maven dependency of " + AsposeConstants.API_NAME + " for java API");
cbVersionDecoration.hide();
examplesTreeDecoration = new ControlDecoration(examplesTree, SWT.TOP | SWT.RIGHT);
examplesTreeDecoration.setImage(fieldDecoration.getImage());
examplesTreeDecoration.setDescriptionText("Please select one example category");
examplesTreeDecoration.hide();
}
示例15: validateTextWidget
import org.eclipse.jface.fieldassist.ControlDecoration; //导入方法依赖的package包/类
private void validateTextWidget(Text text, boolean isEnable, ControlDecoration controlDecoration, Color color){
text.setText("");
text.setEnabled(isEnable);
if(!isEnable){
controlDecoration.hide();
}
text.setBackground(color);
}