本文整理汇总了Java中com.intellij.uiDesigner.ErrorInfo类的典型用法代码示例。如果您正苦于以下问题:Java ErrorInfo类的具体用法?Java ErrorInfo怎么用?Java ErrorInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ErrorInfo类属于com.intellij.uiDesigner包,在下文中一共展示了ErrorInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshIntentionHint
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
public void refreshIntentionHint() {
if(!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)){
hideIntentionHint();
return;
}
if (myHint == null || !myHint.isVisible()) {
updateIntentionHintVisibility();
}
else {
final ErrorInfo[] errorInfos = getErrorInfos();
final Rectangle bounds = getErrorBounds();
if (!haveFixes(errorInfos) || bounds == null || !bounds.equals(myLastHintBounds)) {
hideIntentionHint();
updateIntentionHintVisibility();
}
}
}
示例2: showIntentionPopup
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
final void showIntentionPopup(){
LOG.debug("showIntentionPopup()");
if(myHint == null || !myHint.isVisible()){
return;
}
final ErrorInfo[] errorInfos = getErrorInfos();
if(!haveFixes(errorInfos)){
return;
}
final ArrayList<ErrorWithFix> fixList = new ArrayList<ErrorWithFix>();
for(ErrorInfo errorInfo: errorInfos) {
final QuickFix[] quickFixes = errorInfo.myFixes;
if (quickFixes.length > 0) {
for (QuickFix fix: quickFixes) {
fixList.add(new ErrorWithFix(errorInfo, fix));
}
}
else if (errorInfo.getInspectionId() != null) {
buildSuppressFixes(errorInfo, fixList, true);
}
}
final ListPopup popup = JBPopupFactory.getInstance().createListPopup(new QuickFixPopupStep(fixList, true));
popup.showUnderneathOf(myHint.getComponent());
}
示例3: addError
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
public void addError(@NotNull final String inspectionId, final IComponent component, @Nullable IProperty prop,
@NotNull String errorMessage,
EditorQuickFixProvider... editorQuickFixProviders) {
if (myResults == null) {
myResults = new ArrayList<ErrorInfo>();
}
List<QuickFix> quickFixes = new ArrayList<QuickFix>();
for (EditorQuickFixProvider provider : editorQuickFixProviders) {
if (provider != null) {
quickFixes.add(provider.createQuickFix(myEditor, myComponent));
}
}
final ErrorInfo errorInfo = new ErrorInfo(myComponent, prop == null ? null : prop.getName(), errorMessage,
myProfile.getErrorLevel(HighlightDisplayKey.find(inspectionId), myFormPsiFile),
quickFixes.toArray(new QuickFix[quickFixes.size()]));
errorInfo.setInspectionId(inspectionId);
myResults.add(errorInfo);
}
示例4: valueChanged
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
public void valueChanged(final TreeSelectionEvent e) {
hideIntentionHint();
updateIntentionHintVisibility();
ErrorInfo[] errorInfos = getErrorInfos();
final String text;
if (errorInfos.length > 0 && errorInfos [0].myDescription != null) {
text = errorInfos [0].myDescription;
}
else {
text = "";
}
StatusBar.Info.set(text, myComponent.getProject());
}
示例5: getToolTipText
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
@Override
@Nullable
public String getToolTipText(final MouseEvent e)
{
final TreePath path = getPathForLocation(e.getX(), e.getY());
final RadComponent component = getComponentFromPath(path);
if(component != null)
{
final ErrorInfo errorInfo = ErrorAnalyzer.getErrorForComponent(component);
if(errorInfo != null)
{
return errorInfo.myDescription;
}
}
return null;
}
示例6: showIntentionHint
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
/**
* Shows intention hint (light bulb) if it's not visible yet.
*/
final void showIntentionHint(){
if(!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)){
hideIntentionHint();
return;
}
// 1. Hide previous hint (if any)
hideIntentionHint();
// 2. Found error (if any)
final ErrorInfo[] errorInfos = getErrorInfos();
if(!haveFixes(errorInfos)) {
hideIntentionHint();
return;
}
// 3. Determine position where this hint should be shown
final Rectangle bounds = getErrorBounds();
if(bounds == null){
return;
}
// 4. Show light bulb to fix this error
final LightBulbComponentImpl lightBulbComponent = new LightBulbComponentImpl(this, AllIcons.Actions.IntentionBulb);
myHint = new LightweightHint(lightBulbComponent);
myLastHintBounds = bounds;
myHint.show(myComponent, bounds.x - AllIcons.Actions.IntentionBulb.getIconWidth() - 4, bounds.y, myComponent, new HintHint(myComponent, bounds.getLocation()));
}
示例7: buildSuppressFixes
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
private void buildSuppressFixes(final ErrorInfo errorInfo, final ArrayList<ErrorWithFix> suppressList, boolean named) {
final String suppressName = named
? UIDesignerBundle.message("action.suppress.named.for.component", errorInfo.myDescription)
: UIDesignerBundle.message("action.suppress.for.component");
final String suppressAllName = named
? UIDesignerBundle.message("action.suppress.named.for.all.components", errorInfo.myDescription)
: UIDesignerBundle.message("action.suppress.for.all.components");
final SuppressFix suppressFix = new SuppressFix(myEditor, suppressName,
errorInfo.getInspectionId(), errorInfo.getComponent());
final SuppressFix suppressAllFix = new SuppressFix(myEditor, suppressAllName,
errorInfo.getInspectionId(), null);
suppressList.add(new ErrorWithFix(errorInfo, suppressFix));
suppressList.add(new ErrorWithFix(errorInfo, suppressAllFix));
}
示例8: getErrorForRow
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
/**
* @return first error for the property at the specified row. If component doesn't contain
* any error then the method returns <code>null</code>.
*/
@Nullable
private String getErrorForRow(final int row){
LOG.assertTrue(row < myProperties.size());
final ErrorInfo errorInfo = getErrorInfoForRow(row);
return errorInfo != null ? errorInfo.myDescription : null;
}
示例9: getErrorInfos
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
@NotNull
public ErrorInfo[] getErrorInfos() {
final int selectedRow = myComponent.getSelectedRow();
if(selectedRow < 0 || selectedRow >= myComponent.getRowCount()){
return ErrorInfo.EMPTY_ARRAY;
}
final ErrorInfo info = myComponent.getErrorInfoForRow(selectedRow);
if (info != null) {
return new ErrorInfo[] { info };
}
return ErrorInfo.EMPTY_ARRAY;
}
示例10: getErrorInfos
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
@NotNull protected ErrorInfo[] getErrorInfos() {
final ArrayList<RadComponent> list = FormEditingUtil.getSelectedComponents(getEditor());
if (list.size() != 1) {
return ErrorInfo.EMPTY_ARRAY;
}
return ErrorAnalyzer.getAllErrorsForComponent(list.get(0));
}
示例11: getErrorInfos
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
@NotNull
protected ErrorInfo[] getErrorInfos() {
final RadComponent component = myComponent.getSelectedComponent();
if(component == null){
return ErrorInfo.EMPTY_ARRAY;
}
return ErrorAnalyzer.getAllErrorsForComponent(component);
}
示例12: getErrorForRow
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
/**
* @return first error for the property at the specified row. If component doesn't contain
* any error then the method returns <code>null</code>.
*/
@Nullable
private String getErrorForRow(final int row)
{
LOG.assertTrue(row < myProperties.size());
final ErrorInfo errorInfo = getErrorInfoForRow(row);
return errorInfo != null ? errorInfo.myDescription : null;
}
示例13: getErrorInfos
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
@Override
@NotNull
protected ErrorInfo[] getErrorInfos()
{
final ArrayList<RadComponent> list = FormEditingUtil.getSelectedComponents(getEditor());
if(list.size() != 1)
{
return ErrorInfo.EMPTY_ARRAY;
}
return ErrorAnalyzer.getAllErrorsForComponent(list.get(0));
}
示例14: ErrorWithFix
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
public ErrorWithFix(final ErrorInfo first, final QuickFix second) {
super(first, second);
}
示例15: getTextAttributes
import com.intellij.uiDesigner.ErrorInfo; //导入依赖的package包/类
private SimpleTextAttributes getTextAttributes(final int row, final Property property) {
// 1. Text
ErrorInfo errInfo = getErrorInfoForRow(row);
SimpleTextAttributes result;
boolean modified;
try {
modified = isModifiedForSelection(property);
}
catch(Exception ex) {
// ignore exceptions here - they'll be reported as red property values
modified = false;
}
if (errInfo == null) {
result = modified ? SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES : SimpleTextAttributes.REGULAR_ATTRIBUTES;
}
else {
final HighlightSeverity severity = errInfo.getHighlightDisplayLevel().getSeverity();
Map<HighlightSeverity, SimpleTextAttributes> cache = modified ? myModifiedHighlightAttributes : myHighlightAttributes;
result = cache.get(severity);
if (result == null) {
final TextAttributesKey attrKey = SeverityRegistrar.getSeverityRegistrar(myProject).getHighlightInfoTypeBySeverity(severity).getAttributesKey();
TextAttributes textAttrs = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(attrKey);
if (modified) {
textAttrs = textAttrs.clone();
textAttrs.setFontType(textAttrs.getFontType() | Font.BOLD);
}
result = SimpleTextAttributes.fromTextAttributes(textAttrs);
cache.put(severity, result);
}
}
if (property instanceof IntrospectedProperty) {
final RadComponent c = mySelection.get(0);
if (Properties.getInstance().isPropertyDeprecated(c.getModule(), c.getComponentClass(), property.getName())) {
return new SimpleTextAttributes(result.getBgColor(), result.getFgColor(), result.getWaveColor(),
result.getStyle() | SimpleTextAttributes.STYLE_STRIKEOUT);
}
}
return result;
}