本文整理汇总了Java中org.eclipse.jdt.internal.ui.dialogs.StatusInfo.setError方法的典型用法代码示例。如果您正苦于以下问题:Java StatusInfo.setError方法的具体用法?Java StatusInfo.setError怎么用?Java StatusInfo.setError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.ui.dialogs.StatusInfo
的用法示例。
在下文中一共展示了StatusInfo.setError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: moduleChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
private IStatus moduleChanged() {
StatusInfo status = new StatusInfo();
module = null;
moduleField.enableButton(getPackageFragmentRoot() != null
&& getPackageFragmentRoot().exists()
&& JavaProjectUtilities.isJavaProjectNonNullAndExists(getJavaProject())
&& GWTNature.isGWTProject(getJavaProject().getProject()));
IStatus fieldStatus = moduleField.getStatus();
if (!fieldStatus.isOK()) {
status.setError(fieldStatus.getMessage());
return status;
}
// TODO: verify that package is in client source path of module
module = moduleField.getModule();
return status;
}
示例2: typeNameChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
protected IStatus typeNameChanged() {
IStatus ownerClassNameStatus = super.typeNameChanged();
if (ownerClassNameStatus.getSeverity() == IStatus.ERROR) {
return ownerClassNameStatus;
}
StatusInfo uiXmlNameStatus = new StatusInfo();
IPath uiXmlFilePath = getUiXmlFilePath();
if (uiXmlFilePath != null) {
// Make sure there's not already a ui.xml file with the same name
if (ResourcesPlugin.getWorkspace().getRoot().exists(uiXmlFilePath)) {
uiXmlNameStatus.setError(MessageFormat.format("{0} already exists.",
uiXmlFilePath.lastSegment()));
}
} else {
// Don't need to worry about this case since the ui.xml path should only
// be null if the package fragment is invalid, in which case that error
// will supersede ours.
}
return StatusUtil.getMostSevere(new IStatus[] {
ownerClassNameStatus, uiXmlNameStatus});
}
示例3: setVisible
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
pageVisible = visible;
// Wizards are not allowed to start up with an error message
if (visible) {
setFocus();
if (pageStatus.matches(IStatus.ERROR)) {
StatusInfo status = new StatusInfo();
status.setError("");
pageStatus = status;
}
}
}
示例4: typeNameChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
protected IStatus typeNameChanged() {
StatusInfo status = (StatusInfo) super.typeNameChanged();
String message = status.getMessage();
if (message != null) {
if (message.startsWith(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_TypeNameDiscouraged, ""))
|| message.equals(NewWizardMessages.NewTypeWizardPage_error_TypeNameExists)) {
status.setOK();
} else if (message
.startsWith(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidTypeName, ""))
|| message.equals(NewWizardMessages.NewTypeWizardPage_error_QualifiedName)) {
status.setError(message.replace("Type name", "Name").replace("Java type name", "name")
.replace("type name", "name"));
// errors about *type* names would be confusing here
}
}
return status;
}
示例5: typeNameChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
protected IStatus typeNameChanged() {
StatusInfo status = (StatusInfo) super.typeNameChanged();
String message = status.getMessage();
if (message != null && message.equals(NewWizardMessages.NewTypeWizardPage_error_EnterTypeName)) {
status.setError("Filename is empty.");
}
if (getPackageFragment() != null && getTypeName() != null) {
IFolder folder = (IFolder) getPackageFragment().getResource();
IFile file = folder.getFile(getTypeName() + getSelectedExtension());
if (file.exists()) {
status.setError("File already exists.");
}
}
return status;
}
示例6: validateMaxNumberProblems
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
private IStatus validateMaxNumberProblems() {
String number= getValue(PREF_PB_MAX_PER_UNIT);
StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(PreferencesMessages.JavaBuildConfigurationBlock_empty_input);
} else {
try {
int value= Integer.parseInt(number);
if (value <= 0) {
status.setError(Messages.format(PreferencesMessages.JavaBuildConfigurationBlock_invalid_input, number));
}
} catch (NumberFormatException e) {
status.setError(Messages.format(PreferencesMessages.JavaBuildConfigurationBlock_invalid_input, number));
}
}
return status;
}
示例7: validatePositiveNumber
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Validates that the specified number is positive.
*
* @param number
* The number to validate
* @return The status of the validation
*/
protected static IStatus validatePositiveNumber(final String number) {
final StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(PreferencesMessages.SpellingPreferencePage_empty_threshold);
} else {
try {
final int value= Integer.parseInt(number);
if (value < 0) {
status.setError(Messages.format(PreferencesMessages.SpellingPreferencePage_invalid_threshold, number));
}
} catch (NumberFormatException exception) {
status.setError(Messages.format(PreferencesMessages.SpellingPreferencePage_invalid_threshold, number));
}
}
return status;
}
示例8: superInterfacesChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Hook method that gets called when the list of super interface has changed. The method
* validates the super interfaces and returns the status of the validation.
* <p>
* Subclasses may extend this method to perform their own validation.
* </p>
*
* @return the status of the validation
*/
protected IStatus superInterfacesChanged() {
StatusInfo status= new StatusInfo();
IPackageFragmentRoot root= getPackageFragmentRoot();
fSuperInterfacesDialogField.enableButton(0, root != null);
if (root != null) {
List<InterfaceWrapper> elements= fSuperInterfacesDialogField.getElements();
int nElements= elements.size();
for (int i= 0; i < nElements; i++) {
String intfname= elements.get(i).interfaceName;
Type type= TypeContextChecker.parseSuperInterface(intfname);
if (type == null) {
status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidSuperInterfaceName, BasicElementLabels.getJavaElementName(intfname)));
return status;
}
if (type instanceof ParameterizedType && ! JavaModelUtil.is50OrHigher(root.getJavaProject())) {
status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_SuperInterfaceNotParameterized, BasicElementLabels.getJavaElementName(intfname)));
return status;
}
}
}
return status;
}
示例9: validateAbsoluteFilePath
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Validates that the file with the specified absolute path exists and can
* be opened.
*
* @param path
* The path of the file to validate
* @return a status without error if the path is valid
*/
protected static IStatus validateAbsoluteFilePath(String path) {
final StatusInfo status= new StatusInfo();
IStringVariableManager variableManager= VariablesPlugin.getDefault().getStringVariableManager();
try {
path= variableManager.performStringSubstitution(path);
if (path.length() > 0) {
final File file= new File(path);
if (!file.exists() && (!file.isAbsolute() || !file.getParentFile().canWrite()))
status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
else if (file.exists() && (!file.isFile() || !file.isAbsolute() || !file.canRead() || !file.canWrite()))
status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
}
} catch (CoreException e) {
status.setError(e.getLocalizedMessage());
}
return status;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:28,代码来源:SpellingConfigurationBlock.java
示例10: doValidation
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Validates the entered type or member and updates the status.
*/
private void doValidation() {
StatusInfo status= new StatusInfo();
String newText= fNameDialogField.getText();
if (newText.length() == 0) {
status.setError(""); //$NON-NLS-1$
} else {
IStatus val= JavaConventions.validateJavaTypeName(newText, JavaCore.VERSION_1_3, JavaCore.VERSION_1_3);
if (val.matches(IStatus.ERROR)) {
if (fIsEditingMember)
status.setError(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_error_invalidMemberName);
else
status.setError(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_error_invalidTypeName);
} else {
if (doesExist(newText)) {
status.setError(CallHierarchyMessages.CallHierarchyTypesOrMembersDialog_error_entryExists);
}
}
}
updateStatus(status);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:ExpandWithConstructorsConfigurationBlock.java
示例11: validatePositiveNumber
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Validates that the specified number is positive.
*
* @param number the number to validate
* @return The status of the validation
*/
protected static IStatus validatePositiveNumber(final String number) {
final StatusInfo status= new StatusInfo();
if (number.length() == 0) {
status.setError(PreferencesMessages.SpellingPreferencePage_empty_threshold);
} else {
try {
final int value= Integer.parseInt(number);
if (value < 0) {
status.setError(Messages.format(PreferencesMessages.SpellingPreferencePage_invalid_threshold, number));
}
} catch (NumberFormatException exception) {
status.setError(Messages.format(PreferencesMessages.SpellingPreferencePage_invalid_threshold, number));
}
}
return status;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:23,代码来源:SpellingConfigurationBlock.java
示例12: validateGrammarAccess
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
/**
* Validate grammar.
*
* @return the status (ERROR or OK)
*/
private IStatus validateGrammarAccess() {
StatusInfo status = new StatusInfo();
if (getGrammar() == null || (getGrammar().getName().length() == 0)) {
status.setError(Messages.CHOOSE_GRAMMAR_ID);
}
// update Check ProjectInfo
if (status.isOK()) {
projectInfo.setGrammar(getGrammar());
}
return status;
}
示例13: packageChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
protected IStatus packageChanged() {
StatusInfo status = (StatusInfo) super.packageChanged();
if (status.getMessage() != null
&& status.getMessage().equals(NewWizardMessages.NewTypeWizardPage_warning_DefaultPackageDiscouraged)) {
status.setError("The default package cannot be used in txtUML.");
}
return status;
}
示例14: setVisible
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
fPageVisible= visible;
// policy: wizards are not allowed to come up with an error message
if (visible && fCurrStatus.matches(IStatus.ERROR)) {
StatusInfo status= new StatusInfo();
status.setError(""); //$NON-NLS-1$
fCurrStatus= status;
}
updateStatus(fCurrStatus);
}
示例15: performSelectionChanged
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; //导入方法依赖的package包/类
protected final void performSelectionChanged() {
StatusInfo status= new StatusInfo();
IStructuredSelection selection= (IStructuredSelection) fFixSelectionTable.getSelection();
Object firstElement= selection.getFirstElement();
if (firstElement instanceof ClasspathFixProposal) {
fSelectedFix= (ClasspathFixProposal) firstElement;
} else {
status.setError(""); //$NON-NLS-1$
}
updateStatus(status);
}