void () { if (!myEditor.ensureEditable()) { return; } Runnable runnable = () -> { final Palette palette = Palette.getInstance(myEditor.getProject()); IntrospectedProperty[] props = palette.getIntrospectedProperties(myLabel); boolean modified = false; for(IntrospectedProperty prop: props) { if (prop.getName().equals(SwingProperties.LABEL_FOR) && prop instanceof IntroComponentProperty icp) { icp.setValueEx(myLabel, myComponent.getId()); modified = true; break; } } if (modified) myEditor.refreshAndSave(false); }; CommandProcessor.getInstance().executeCommand(myEditor.getProject(), runnable, UIDesignerBundle.message("inspection.no.label.for.command"), null); }