當前位置: 首頁>>代碼示例>>Java>>正文


Java POMExtensibilityElement.setElementText方法代碼示例

本文整理匯總了Java中org.netbeans.modules.maven.model.pom.POMExtensibilityElement.setElementText方法的典型用法代碼示例。如果您正苦於以下問題:Java POMExtensibilityElement.setElementText方法的具體用法?Java POMExtensibilityElement.setElementText怎麽用?Java POMExtensibilityElement.setElementText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.netbeans.modules.maven.model.pom.POMExtensibilityElement的用法示例。


在下文中一共展示了POMExtensibilityElement.setElementText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setSimpleParameter

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
@Override
public void setSimpleParameter(String parameter, String value) {
    List<POMExtensibilityElement> list = getConfigurationElements();
    for (POMExtensibilityElement e : list) {
        if (parameter.equals(e.getQName().getLocalPart())) {
            if (value == null) {
                removeChild(e.getQName().getLocalPart(), e);
            } else {
                e.setElementText(value);
            }
            return;
        }
    }
    if (value != null) {
        POMExtensibilityElement el = getModel().getFactory().createPOMExtensibilityElement(POMQName.createQName(parameter));
        el.setElementText(value);
        addExtensibilityElement(el);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:20,代碼來源:ConfigurationImpl.java

示例2: createContextPath

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private POMExtensibilityElement createContextPath( String name,
        POMModel model )
{
    QName qname =
            POMQName.createQName(CONTEXT_PATH, model.getPOMQNames()
                    .isNSAware());
    POMExtensibilityElement contextPath =
            model.getFactory().createPOMExtensibilityElement(qname);
    String cPath = "/";
    try {
        cPath += URLEncoder.encode(name, UTF_8);
    }
    catch (UnsupportedEncodingException ignore) {
    }
    contextPath.setElementText(cPath);
    return contextPath;
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:18,代碼來源:VaadinProjectWizardIterator.java

示例3: setBooleanVaue

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
public static void setBooleanVaue( String optionName,
        Map<String, POMExtensibilityElement> values, JCheckBox checkBox,
        Configuration configuration )
{
    POMExtensibilityElement element = values.get(optionName);
    boolean isEnabled = checkBox.isSelected();
    if (element == null) {
        if (isEnabled) {
            configuration.addExtensibilityElement(POMUtils.createElement(
                    configuration.getModel(), optionName,
                    Boolean.TRUE.toString()));
        }
    }
    else {
        String value = getValue(element);
        if (!value.equals(Boolean.toString(isEnabled))) {
            element.setElementText(Boolean.toString(isEnabled));
        }
    }
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:21,代碼來源:POMUtils.java

示例4: performOperation

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
@Override
public void performOperation(POMModel model) {
    Configuration config = config(model);
    POMExtensibilityElement e = ModelUtils.getOrCreateChild(config, property, config.getModel());
    if (modifiedValue == null || modifiedValue.isEmpty()) {
        //TODO for this case config(model) method which creates the configuration element is wrong..
        config.removeExtensibilityElement(e);
    } else {
        e.setElementText(modifiedValue);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:InstallerPanel.java

示例5: performOperation

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的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

示例6: createVersion

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private POMExtensibilityElement createVersion( POMModel model,
        String value )
{
    QName qname =
            POMQName.createQName(POMUtils.VAADIN_PLUGIN_VERSION, model
                    .getPOMQNames().isNSAware());
    POMExtensibilityElement version =
            model.getFactory().createPOMExtensibilityElement(qname);
    version.setElementText(value);
    return version;
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:12,代碼來源:VaadinOptionsPanel.java

示例7: createRunTarget

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private POMExtensibilityElement createRunTarget( String name, POMModel model )
{
    QName qname =
            POMQName.createQName(RUN_TARGET, model.getPOMQNames()
                    .isNSAware());
    POMExtensibilityElement runTarget =
            model.getFactory().createPOMExtensibilityElement(qname);
    runTarget.setElementText("http://localhost:8080/" + name); // NOI18N
    return runTarget;
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:11,代碼來源:VaadinProjectWizardIterator.java

示例8: setWidgetset

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
public static void setWidgetset( POMExtensibilityElement widgetsets,
        String widget )
{
    String oldValue = POMUtils.getValue(widgetsets);
    if (oldValue == null || !oldValue.equals(widget)) {
        widgetsets.setElementText(widget);
    }
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:9,代碼來源:POMUtils.java

示例9: setTextField

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
public static void setTextField( String optionName,
        Map<String, POMExtensibilityElement> values, JTextField textField,
        POMComponent component )
{
    POMExtensibilityElement element = values.get(optionName);
    if (element == null) {
        if (textField.getText().trim().length() > 0) {
            component.addExtensibilityElement(POMUtils.createElement(
                    component.getModel(), optionName, textField.getText()));
        }
    }
    else if (!getValue(element).equals(textField.getText().trim())) {
        element.setElementText(textField.getText());
    }
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:16,代碼來源:POMUtils.java

示例10: createElement

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
public static POMExtensibilityElement createElement( POMModel model,
        String name, String value )
{
    QName qname =
            POMQName.createQName(name, model.getPOMQNames().isNSAware());
    POMExtensibilityElement element =
            model.getFactory().createPOMExtensibilityElement(qname);
    if (value != null) {
        element.setElementText(value);
    }
    return element;
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:13,代碼來源:POMUtils.java

示例11: setOptions

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private void setOptions( Configuration configuration ) {
    POMModel model = configuration.getModel();
    List<POMExtensibilityElement> params = configuration
            .getExtensibilityElements();
    Map<String, POMExtensibilityElement> values = new HashMap<>();
    for (POMExtensibilityElement param : params) {
        values.put(param.getQName().getLocalPart(), param);
    }

    POMUtils.setTextField(WEBAPP_DIRECTORY, values, myWebApp,
            configuration);

    if (myPersistenceCache.isSelected()) {
        POMUtils.setTextField(PERSISTENT_UNIT_CACHEDIR, values,
                myPersistUnitCacheDir, configuration);
    }

    POMExtensibilityElement optimization = values
            .get(OPTIMIZATION_LEVEL);
    if (optimization == null) {
        if (myOptimization.getValue() > -1) {
            configuration.addExtensibilityElement(POMUtils
                    .createElement(model, OPTIMIZATION_LEVEL,
                            myOptimizationValue.getText()));
        }
    }
    else {
        if (myOptimization.getValue() > -1
                && !POMUtils.getValue(optimization).equals(
                        myOptimizationValue.getText()))
        {
            optimization.setElementText(myOptimizationValue.getText());
        }
        else {
            configuration.removeExtensibilityElement(optimization);
        }
    }

    POMUtils.setBooleanVaue(COMPILE_REPORT, values, myCompileReport,
            configuration);
    POMUtils.setBooleanVaue(STRICT, values, myStrict, configuration);
    POMUtils.setBooleanVaue(FORCE, values, myForce, configuration);
    POMUtils.setBooleanVaue(SKIP, values, mySkip, configuration);
    POMUtils.setBooleanVaue(VALIDATE_ONLY, values, myValidate,
            configuration);
    POMUtils.setBooleanVaue(TREE_LOGGER, values, myTreeLogger,
            configuration);
    POMUtils.setBooleanVaue(PERSISTENT_UNIT_CACHE, values,
            myPersistenceCache, configuration);
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:51,代碼來源:AdvancedGwtOptionsPanel.java

示例12: setOptions

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private void setOptions( Configuration configuration ) {
    POMModel model = configuration.getModel();
    List<POMExtensibilityElement> params = configuration
            .getExtensibilityElements();
    Map<String, POMExtensibilityElement> values = new HashMap<>();
    for (POMExtensibilityElement param : params) {
        values.put(param.getQName().getLocalPart(), param);
    }

    POMUtils.setTextField(JVM_ARGS, values, myJvmArgs, configuration);

    POMExtensibilityElement style = values.get(STYLE);
    JSStyle item = (JSStyle) myStyle.getSelectedItem();
    if (item != null) {
        if (style == null) {
            configuration.addExtensibilityElement(POMUtils
                    .createElement(model, STYLE, item.getValue()));
        }
        else {
            String value = POMUtils.getValue(style);
            JSStyle oldValue = JSStyle.forString(value);
            if (!oldValue.equals(item)) {
                style.setElementText(item.getValue());
            }
        }
    }

    POMExtensibilityElement logging = values.get(LOG_LEVEL);
    GwtLogLevel logItem = (GwtLogLevel) myLogLevel.getSelectedItem();
    if (logItem != null) {
        if (logging == null) {
            if (!logItem.equals(GwtLogLevel.INFO)) {
                configuration
                        .addExtensibilityElement(POMUtils
                                .createElement(model, LOG_LEVEL,
                                        logItem.name()));
            }
        }
        else {
            if (!POMUtils.getValue(logging).equals(logItem.name())) {
                logging.setElementText(logItem.name());
            }
        }
    }

    try {
        String threadsValue = ((DefaultEditor) myThreads.getEditor())
                .getTextField().getText();
        if (threadsValue.length() > 0) {
            Integer newValue = Integer.parseInt(threadsValue);
            if (((Integer) myThreads.getValue()) > 0) {
                POMExtensibilityElement threads = values
                        .get(LOCAL_WORKERS);
                if (threads == null) {
                    configuration.addExtensibilityElement(POMUtils
                            .createElement(model, LOCAL_WORKERS,
                                    threadsValue));
                }
                else {
                    if (!POMUtils.getValue(threads).equals(
                            String.valueOf(newValue)))
                    {
                        threads.setElementText(threadsValue);
                    }
                }
            }
        }
    }
    catch (NumberFormatException ignore) {
    }

    POMUtils.setBooleanVaue(DRAFT, values, myDraft, configuration);
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:74,代碼來源:GwtCompilerOptionsPanel.java

示例13: setOptions

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private void setOptions( Configuration configuration ) {
    POMModel model = configuration.getModel();
    List<POMExtensibilityElement> params = configuration
            .getExtensibilityElements();
    Map<String, POMExtensibilityElement> values = new HashMap<>();
    for (POMExtensibilityElement param : params) {
        values.put(param.getQName().getLocalPart(), param);
    }

    POMUtils.setTextField(CLASSES_DIRECTORY, values, myOutputDir,
            configuration);
    POMExtensibilityElement reloadMode = values.get(RELOAD);
    ReloadMode mode = (ReloadMode) myReload.getSelectedItem();
    if (reloadMode == null) {
        if (mode != ReloadMode.AUTOMATIC) {
            configuration.addExtensibilityElement(POMUtils
                    .createElement(model, RELOAD, mode.toString()));
        }
    }
    else if (!POMUtils.getValue(reloadMode).equals(mode.toString())) {
        reloadMode.setElementText(mode.toString());
    }

    if (mode.equals(ReloadMode.AUTOMATIC)) {
        POMExtensibilityElement scanInterval = values
                .get(SCAN_INTERVAL_SECONDS);
        try {
            myScanInterval.commitEdit();
        }
        catch (ParseException ignore) {
        }
        Integer scanIntervalValue = (Integer) myScanInterval.getValue();
        String newValue = scanIntervalValue.toString();
        if (scanInterval == null) {
            if (scanIntervalValue > 0) {
                configuration.addExtensibilityElement(POMUtils
                        .createElement(model, SCAN_INTERVAL_SECONDS,
                                newValue));
            }
        }
        else if (!POMUtils.getValue(scanInterval).equals(newValue)
                && scanIntervalValue >= 0)
        {
            scanInterval.setElementText(newValue);
        }
    }

    POMExtensibilityElement webApp = values.get(WEB_APP);
    String ctxtPath = myCtxtPath.getText().trim();
    if (webApp == null) {
        if (ctxtPath.length() != 0) {
            POMExtensibilityElement ctxtPathElement = POMUtils
                    .createElement(model, CONTEXT_PATH, ctxtPath);
            webApp = POMUtils.createElement(model, WEB_APP, null);
            webApp.addExtensibilityElement(ctxtPathElement);
            configuration.addExtensibilityElement(webApp);
        }
    }
    else {
        List<POMExtensibilityElement> webAppConfs = webApp
                .getExtensibilityElements();
        Map<String, POMExtensibilityElement> map = new HashMap<>();
        for (POMExtensibilityElement conf : webAppConfs) {
            if (conf.getQName().getLocalPart().equals(CONTEXT_PATH)) {
                map.put(CONTEXT_PATH, conf);
                break;
            }
        }

        POMUtils.setTextField(CONTEXT_PATH, map, myCtxtPath, webApp);
    }

    POMExtensibilityElement scanTargets = values.get(SCAN_TARGETS);
    setTargets(model, scanTargets);
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:76,代碼來源:JettyOptionsPanel.java

示例14: performOperation

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的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

示例15: setRunTarget

import org.netbeans.modules.maven.model.pom.POMExtensibilityElement; //導入方法依賴的package包/類
private void setRunTarget( String name, POMModel model ) {
    Plugin plugin = getVaadinPlugin(model);
    if (plugin == null) {
        return;
    }
    Configuration configuration = plugin.getConfiguration();
    if (configuration == null) {
        configuration = model.getFactory().createConfiguration();
        configuration.addExtensibilityElement(createRunTarget(name, model));
        plugin.setConfiguration(configuration);
    }
    else {
        List<POMExtensibilityElement> children =
                configuration.getExtensibilityElements();
        for (POMExtensibilityElement child : children) {
            if (RUN_TARGET.equals(child.getQName().getLocalPart())) {
                String target = child.getElementText();
                URI uri;
                try {
                    uri = new URI(target);
                    URL url = uri.toURL();
                    String file = url.getFile();
                    if (file != null) {
                        if (file.length() == 0) {
                            target = target + '/' + name;
                        }
                        else if (file.length() == 1
                                && file.charAt(0) == '/')
                        {
                            target += name;
                        }
                        child.setElementText(target);
                    }
                }
                catch (URISyntaxException | MalformedURLException e) {
                    LOG.log(Level.INFO, null, e);
                }
                return;
            }
        }
        configuration.addExtensibilityElement(createRunTarget(name, model));
    }
}
 
開發者ID:vaadin,項目名稱:netbeans-plugin,代碼行數:44,代碼來源:VaadinProjectWizardIterator.java


注:本文中的org.netbeans.modules.maven.model.pom.POMExtensibilityElement.setElementText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。