Search in sources :

Example 11 with StringDescriptor

use of com.intellij.uiDesigner.lw.StringDescriptor in project intellij-community by JetBrains.

the class IntroStringProperty method refreshValue.

public boolean refreshValue(RadComponent component) {
    StringDescriptor descriptor = getValue(component);
    if (descriptor.getValue() != null)
        return false;
    String oldResolvedValue = descriptor.getResolvedValue();
    descriptor.setResolvedValue(null);
    try {
        setValueImpl(component, descriptor);
        return !Comparing.equal(oldResolvedValue, descriptor.getResolvedValue());
    } catch (Exception e) {
        LOG.error(e);
        return false;
    }
}
Also used : StringDescriptor(com.intellij.uiDesigner.lw.StringDescriptor)

Example 12 with StringDescriptor

use of com.intellij.uiDesigner.lw.StringDescriptor in project intellij-community by JetBrains.

the class StringEditorDialog method doOKAction.

@Override
protected void doOKAction() {
    if (myForm.myRbResourceBundle.isSelected()) {
        final StringDescriptor descriptor = getDescriptor();
        if (descriptor != null && descriptor.getKey().length() > 0) {
            final String value = myForm.myTfRbValue.getText();
            final PropertiesFile propFile = getPropertiesFile(descriptor);
            if (propFile != null && propFile.findPropertyByKey(descriptor.getKey()) == null) {
                saveCreatedProperty(propFile, descriptor.getKey(), value, myEditor.getPsiFile());
            } else {
                final String newKeyName = saveModifiedPropertyValue(myEditor.getModule(), descriptor, myLocale, value, myEditor.getPsiFile());
                if (newKeyName != null) {
                    myForm.myTfKey.setText(newKeyName);
                }
            }
        }
    }
    super.doOKAction();
}
Also used : StringDescriptor(com.intellij.uiDesigner.lw.StringDescriptor) PropertiesFile(com.intellij.lang.properties.psi.PropertiesFile)

Aggregations

StringDescriptor (com.intellij.uiDesigner.lw.StringDescriptor)12 IProperty (com.intellij.uiDesigner.lw.IProperty)3 Nullable (org.jetbrains.annotations.Nullable)3 PropertiesFile (com.intellij.lang.properties.psi.PropertiesFile)2 HashMap (java.util.HashMap)2 Element (org.jdom.Element)2 JavaI18nizeQuickFixDialog (com.intellij.codeInspection.i18n.JavaI18nizeQuickFixDialog)1 InstrumentationClassFinder (com.intellij.compiler.instrumentation.InstrumentationClassFinder)1 Project (com.intellij.openapi.project.Project)1 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)1 PsiFile (com.intellij.psi.PsiFile)1 GridConstraints (com.intellij.uiDesigner.core.GridConstraints)1 SupportCode (com.intellij.uiDesigner.core.SupportCode)1 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)1 IncorrectOperationException (com.intellij.util.IncorrectOperationException)1 Rectangle2D (java.awt.geom.Rectangle2D)1 Map (java.util.Map)1 Type (org.jetbrains.org.objectweb.asm.Type)1 Method (org.jetbrains.org.objectweb.asm.commons.Method)1