public class SetColumnWidthsFragment extends com.sodius.mdw.internal.metamodel.doors.io.commands.SetColumnWidthsFragmentImpl implements ShareModuleFragment
The new columns widths are specified in pixel. The number of columns widths (i.e. the size of the width array) must of course match the existing table columns count.
If the number of columns contained in the table needs to be change, a ResizeTableFragment
fragment should be used instead.
This fragment is intended to be combined into an EditModuleCommand
instance.
Below is a snippet illustrating how to use this fragment (see CommandRunner
for a full snippet):
ModuleRef module = ModuleRef.qualifiedName("/MyFolder/MyModule"); EditModuleCommand command = new EditModuleCommand(module, TerminationMode.SAVE_AND_CLOSE); ObjectRef table = ObjectRef.absoluteNumber(5); int[] widths = new int[] { 200, 250, 90, 450 }; command.add(new SetColumnWidthsFragment(table, widths)); myCommandRunner.run(command);
CommandRunner
,
EditModuleCommand
,
ResizeTableFragment
Constructor and Description |
---|
SetColumnWidthsFragment(ObjectRef table,
int[] widths)
Instantiates a fragment to change the size of columns contained in the specified DOORS table.
|
public SetColumnWidthsFragment(ObjectRef table, int[] widths)
table
- the table whose column sizes need to be updated.widths
- the new width (in pixel) of each column of the table.