Search in sources :

Example 1 with AbstractRegionCommand

use of org.eclipse.nebula.widgets.nattable.command.AbstractRegionCommand in project nebula.widgets.nattable by eclipse.

the class DimensionallyDependentLayer method doCommand.

// Commands
@Override
public boolean doCommand(ILayerCommand command) {
    // Invoke command handler(s) on the Dimensionally dependent layer
    ILayerCommand clonedCommand = command.cloneCommand();
    if (super.doCommand(clonedCommand)) {
        return true;
    }
    // that no other regions are affected
    if (!(command instanceof AbstractRegionCommand)) {
        clonedCommand = command.cloneCommand();
        if (this.horizontalLayerDependency.doCommand(clonedCommand)) {
            return true;
        }
        clonedCommand = command.cloneCommand();
        if (this.verticalLayerDependency.doCommand(clonedCommand)) {
            return true;
        }
    }
    return this.baseLayer.doCommand(command);
}
Also used : AbstractRegionCommand(org.eclipse.nebula.widgets.nattable.command.AbstractRegionCommand) ILayerCommand(org.eclipse.nebula.widgets.nattable.command.ILayerCommand)

Example 2 with AbstractRegionCommand

use of org.eclipse.nebula.widgets.nattable.command.AbstractRegionCommand in project nebula.widgets.nattable by eclipse.

the class CompositeLayer method doCommand.

/**
 * {@inheritDoc} Handle commands
 */
@Override
public boolean doCommand(ILayerCommand command) {
    if (super.doCommand(command)) {
        return true;
    }
    if (command instanceof AbstractRegionCommand && ((AbstractRegionCommand) command).label != null) {
        AbstractRegionCommand arc = ((AbstractRegionCommand) command);
        ILayer child = getChildLayerByRegionName(arc.label);
        if (child != null) {
            // execute and return true because the command was executed for
            // a specific region that has been found, so nobody else should
            // handle it further
            child.doCommand(arc.cloneForRegion());
            return true;
        }
    }
    return doCommandOnChildLayers(command);
}
Also used : AbstractRegionCommand(org.eclipse.nebula.widgets.nattable.command.AbstractRegionCommand)

Aggregations

AbstractRegionCommand (org.eclipse.nebula.widgets.nattable.command.AbstractRegionCommand)2 ILayerCommand (org.eclipse.nebula.widgets.nattable.command.ILayerCommand)1