当前位置: 首页>>代码示例>>Java>>正文


Java Properties.getExtensibilityElements方法代码示例

本文整理汇总了Java中org.netbeans.modules.maven.model.pom.Properties.getExtensibilityElements方法的典型用法代码示例。如果您正苦于以下问题:Java Properties.getExtensibilityElements方法的具体用法?Java Properties.getExtensibilityElements怎么用?Java Properties.getExtensibilityElements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.modules.maven.model.pom.Properties的用法示例。


在下文中一共展示了Properties.getExtensibilityElements方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: performOperation

import org.netbeans.modules.maven.model.pom.Properties; //导入方法依赖的package包/类
@Override
public void performOperation( POMModel model ) {
    Properties properties = model.getProject().getProperties();
    if (properties == null) {
        model.getProject().setProperties(
                createProperties(model, myVersion));
    }
    else {
        List<POMExtensibilityElement> props =
                properties.getExtensibilityElements();
        boolean versionSet = false;
        for (POMExtensibilityElement prop : props) {
            if (prop.getQName().getLocalPart()
                    .equals(POMUtils.VAADIN_PLUGIN_VERSION))
            {
                String newVersion = myVersion;
                if (newVersion.equals(prop.getElementText())) {
                    return;
                }
                prop.setElementText(newVersion);
                versionSet = true;
                break;
            }
        }
        if (!versionSet) {
            properties.addExtensibilityElement(createVersion(model,
                    myVersion));
        }
    }
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:31,代码来源:VaadinOptionsPanel.java

示例2: performOperation

import org.netbeans.modules.maven.model.pom.Properties; //导入方法依赖的package包/类
@Override
public void performOperation( POMModel model ) {
    Properties properties = model.getProject().getProperties();
    boolean needProperties = properties == null;
    if (needProperties) {
        properties = model.getFactory().createProperties();
    }
    List<POMExtensibilityElement> props =
            properties.getExtensibilityElements();
    Map<String, POMExtensibilityElement> values = new HashMap<>();
    for (POMExtensibilityElement param : props) {
        values.put(param.getQName().getLocalPart(), param);
    }
    String version =
            (String) myVaadinVersion.getModel().getSelectedItem();
    if (version != null) {
        POMExtensibilityElement versionElement =
                values.get(POMUtils.VAADIN_PLUGIN_VERSION);
        if (versionElement == null) {
            versionElement =
                    POMUtils.createElement(model,
                            POMUtils.VAADIN_PLUGIN_VERSION,
                            version.toString());
            properties.addExtensibilityElement(versionElement);
        }
        else {
            String oldValue = POMUtils.getValue(versionElement);
            if (oldValue == null
                    || !oldValue.equals(version.toString()))
            {
                versionElement.setElementText(version.toString());
            }
        }
    }
    POMUtils.setTextField(IMPLEMENTATION_TITLE, values, myImplTitle,
            properties);
    POMUtils.setTextField(IMPLEMENTATION_VERSION, values,
            myImplVersion, properties);
    POMUtils.setTextField(IMPLEMENTATION_VENDOR, values, myImplVendor,
            properties);
    if (needProperties) {
        model.getProject().setProperties(properties);
    }

    POMExtensibilityElement widgetsets = POMUtils.getWidgetsets(model);
    if (widgetsets == null) {
        POMUtils.createWidgetset(model, myWidgetset.getText().trim());
    }
    else {
        POMUtils.setWidgetset(widgetsets, myWidgetset.getText().trim());
    }
}
 
开发者ID:vaadin,项目名称:netbeans-plugin,代码行数:53,代码来源:AddOnOptionsPanel.java


注:本文中的org.netbeans.modules.maven.model.pom.Properties.getExtensibilityElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。