Search in sources :

Example 1 with ModelContentOutPortView

use of org.knime.core.node.workflow.ModelContentOutPortView in project knime-core by knime.

the class FilterDefinitionHandlerPortObject method getViews.

/**
 * {@inheritDoc}
 */
@Override
public JComponent[] getViews() {
    ModelContent model = new ModelContent("FilterDefinition");
    Config columnConfig = model.addConfig("Column");
    getSpec().forEach(col -> col.getFilterHandler().ifPresent(handler -> handler.save(columnConfig.addConfig(col.getName()))));
    return new JComponent[] { new ModelContentOutPortView(model) };
}
Also used : JComponent(javax.swing.JComponent) PortTypeRegistry(org.knime.core.node.port.PortTypeRegistry) ModelContent(org.knime.core.node.ModelContent) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView) DataTableSpec(org.knime.core.data.DataTableSpec) Config(org.knime.core.node.config.Config) PortType(org.knime.core.node.port.PortType) ModelContent(org.knime.core.node.ModelContent) Config(org.knime.core.node.config.Config) JComponent(javax.swing.JComponent) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView)

Example 2 with ModelContentOutPortView

use of org.knime.core.node.workflow.ModelContentOutPortView in project knime-core by knime.

the class SizeHandlerPortObject method getViews.

/**
 * {@inheritDoc}
 */
@Override
public JComponent[] getViews() {
    ModelContent model = new ModelContent("Size");
    getSpec().getColumnSpec(0).getSizeHandler().save(model);
    return new JComponent[] { new ModelContentOutPortView(model) };
}
Also used : ModelContent(org.knime.core.node.ModelContent) JComponent(javax.swing.JComponent) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView)

Example 3 with ModelContentOutPortView

use of org.knime.core.node.workflow.ModelContentOutPortView in project knime-core by knime.

the class ShapeHandlerPortObject method getViews.

/**
 * {@inheritDoc}
 */
@Override
public JComponent[] getViews() {
    ModelContent model = new ModelContent("Shape");
    getSpec().getColumnSpec(0).getShapeHandler().save(model);
    return new JComponent[] { new ModelContentOutPortView(model) };
}
Also used : ModelContent(org.knime.core.node.ModelContent) JComponent(javax.swing.JComponent) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView)

Example 4 with ModelContentOutPortView

use of org.knime.core.node.workflow.ModelContentOutPortView in project knime-core by knime.

the class AbstractSimplePortObjectSpec method getViews.

/**
 * {@inheritDoc}
 */
@Override
public JComponent[] getViews() {
    ModelContent model = new ModelContent("Model Content Spec");
    save(model);
    return new JComponent[] { new ModelContentOutPortView(model) };
}
Also used : ModelContent(org.knime.core.node.ModelContent) JComponent(javax.swing.JComponent) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView)

Example 5 with ModelContentOutPortView

use of org.knime.core.node.workflow.ModelContentOutPortView in project knime-core by knime.

the class AbstractSimplePortObject method getViews.

/**
 * {@inheritDoc}
 */
@Override
public JComponent[] getViews() {
    try {
        ModelContent model = new ModelContent("Model Content");
        save(model, new ExecutionMonitor());
        return new JComponent[] { new ModelContentOutPortView(model) };
    } catch (CanceledExecutionException cee) {
    // should not be possible
    }
    return null;
}
Also used : CanceledExecutionException(org.knime.core.node.CanceledExecutionException) ModelContent(org.knime.core.node.ModelContent) JComponent(javax.swing.JComponent) ExecutionMonitor(org.knime.core.node.ExecutionMonitor) ModelContentOutPortView(org.knime.core.node.workflow.ModelContentOutPortView)

Aggregations

JComponent (javax.swing.JComponent)6 ModelContent (org.knime.core.node.ModelContent)6 ModelContentOutPortView (org.knime.core.node.workflow.ModelContentOutPortView)6 DataTableSpec (org.knime.core.data.DataTableSpec)1 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)1 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)1 Config (org.knime.core.node.config.Config)1 PortType (org.knime.core.node.port.PortType)1 PortTypeRegistry (org.knime.core.node.port.PortTypeRegistry)1