Search in sources :

Example 6 with StringParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue in project constellation by constellation-app.

the class SaveTemplateAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    final Plugin plugin = PluginRegistry.get(GraphNodePluginRegistry.SAVE_TEMPLATE);
    final PluginParameters params = plugin.createParameters();
    while (true) {
        final PluginParametersSwingDialog dialog = new PluginParametersSwingDialog(Bundle.CTL_SaveTemplateAction(), params);
        dialog.showAndWait();
        if (PluginParametersDialog.OK.equals(dialog.getResult())) {
            if (NewSchemaGraphAction.getTemplateNames().containsKey(params.getStringValue(SaveTemplatePlugin.TEMPLATE_NAME_PARAMETER_ID))) {
                final PluginParameters warningParams = new PluginParameters();
                final PluginParameter<StringParameterValue> warningMessageParam = StringParameterType.build("");
                warningMessageParam.setName("");
                warningMessageParam.setStringValue("Warning template with that name already exists - really overwrite?");
                StringParameterType.setIsLabel(warningMessageParam, true);
                warningParams.addParameter(warningMessageParam);
                final PluginParametersSwingDialog overwrite = new PluginParametersSwingDialog("Overwrite?", warningParams);
                overwrite.showAndWait();
                if (!PluginParametersDialog.OK.equals(overwrite.getResult())) {
                    continue;
                }
            }
            Future<?> f = PluginExecution.withPlugin(plugin).withParameters(params).executeLater(context.getGraph());
            PluginExecution.withPlugin(new SimplePlugin() {

                @Override
                public String getName() {
                    return "Update Template Menu";
                }

                @Override
                protected void execute(final PluginGraphs graphs, final PluginInteraction interaction, final PluginParameters parameters) throws InterruptedException, PluginException {
                    NewSchemaGraphAction.recreateTemplateMenuItems();
                }
            }).waitingFor(f).executeLater(null);
        }
        break;
    }
}
Also used : PluginGraphs(au.gov.asd.tac.constellation.plugins.PluginGraphs) PluginException(au.gov.asd.tac.constellation.plugins.PluginException) StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParametersSwingDialog(au.gov.asd.tac.constellation.plugins.gui.PluginParametersSwingDialog) PluginInteraction(au.gov.asd.tac.constellation.plugins.PluginInteraction) SimplePlugin(au.gov.asd.tac.constellation.plugins.templates.SimplePlugin) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) Plugin(au.gov.asd.tac.constellation.plugins.Plugin) SimplePlugin(au.gov.asd.tac.constellation.plugins.templates.SimplePlugin)

Example 7 with StringParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue in project constellation by constellation-app.

the class LoadTemplatePlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters params = new PluginParameters();
    final PluginParameter<ObjectParameterValue> fileParam = ObjectParameterType.build(TEMPLATE_FILE_PARAMETER_ID);
    final PluginParameter<StringParameterValue> nameParam = StringParameterType.build(TEMPLATE_NAME_PARAMETER_ID);
    params.addParameter(fileParam);
    params.addParameter(nameParam);
    return params;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters) ObjectParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.ObjectParameterType.ObjectParameterValue)

Example 8 with StringParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue in project constellation by constellation-app.

the class DateTimeCustomFormatter method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters params = new PluginParameters();
    final PluginParameter<StringParameterValue> formatParameter = StringParameterType.build(FORMAT_PARAMETER_ID);
    formatParameter.setName("Format");
    formatParameter.setStringValue("yyyy-MM-dd hh:mm:ss");
    params.addParameter(formatParameter);
    return params;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 9 with StringParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue in project constellation by constellation-app.

the class ExportToImagePlugin method createParameters.

@Override
public PluginParameters createParameters() {
    final PluginParameters parameters = new PluginParameters();
    final PluginParameter<StringParameterValue> imageFileParam = StringParameterType.build(FILE_NAME_PARAMETER_ID);
    imageFileParam.setDescription("File to write to");
    parameters.addParameter(imageFileParam);
    return parameters;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Example 10 with StringParameterValue

use of au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue in project constellation by constellation-app.

the class SubstringFormatter method createParameters.

@Override
public PluginParameters createParameters() {
    PluginParameters params = new PluginParameters();
    final PluginParameter<StringParameterValue> startParameter = StringParameterType.build(START_PARAMETER_ID);
    startParameter.setName("Start");
    startParameter.setStringValue("");
    params.addParameter(startParameter);
    final PluginParameter<StringParameterValue> endParameter = StringParameterType.build(END_PARAMETER_ID);
    endParameter.setName("End");
    endParameter.setStringValue("");
    params.addParameter(endParameter);
    return params;
}
Also used : StringParameterValue(au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue) PluginParameters(au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)

Aggregations

PluginParameters (au.gov.asd.tac.constellation.plugins.parameters.PluginParameters)50 StringParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.StringParameterValue)50 BooleanParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.BooleanParameterType.BooleanParameterValue)13 SingleChoiceParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.SingleChoiceParameterType.SingleChoiceParameterValue)9 PluginParameter (au.gov.asd.tac.constellation.plugins.parameters.PluginParameter)6 ObjectParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ObjectParameterType.ObjectParameterValue)5 ArrayList (java.util.ArrayList)5 Map (java.util.Map)5 ParameterChange (au.gov.asd.tac.constellation.plugins.parameters.ParameterChange)3 IntegerParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.IntegerParameterType.IntegerParameterValue)3 Graph (au.gov.asd.tac.constellation.graph.Graph)2 ColorParameterValue (au.gov.asd.tac.constellation.plugins.parameters.types.ColorParameterType.ColorParameterValue)2 NbPreferences (org.openide.util.NbPreferences)2 GraphElementType (au.gov.asd.tac.constellation.graph.GraphElementType)1 GraphReadMethods (au.gov.asd.tac.constellation.graph.GraphReadMethods)1 GraphWriteMethods (au.gov.asd.tac.constellation.graph.GraphWriteMethods)1 ReadableGraph (au.gov.asd.tac.constellation.graph.ReadableGraph)1 StoreGraph (au.gov.asd.tac.constellation.graph.StoreGraph)1 GraphDataObject (au.gov.asd.tac.constellation.graph.file.GraphDataObject)1 GraphObjectUtilities (au.gov.asd.tac.constellation.graph.file.GraphObjectUtilities)1