Package gov.nasa.arc.mct.table.view

Examples of gov.nasa.arc.mct.table.view.AbbreviationSettings


    AbbreviationsImpl availableAbbreviations = new AbbreviationsImpl("value");
    availableAbbreviations.addPhrase("Amps", Collections.singletonList("A"));
    availableAbbreviations.addPhrase("BCA1", Collections.<String>emptyList());
    availableAbbreviations.addPhrase("Ch1", Collections.<String>emptyList());
    availableAbbreviations.addPhrase("Serial", Collections.<String>emptyList());
    AbbreviationSettings aSettings = new AbbreviationSettings("fullLabel", availableAbbreviations, new LabelAbbreviations());
    String abbreviatedLabel = aSettings.getAbbreviatedLabel();
    Assert.assertEquals(abbreviatedLabel, "Amps BCA1 Ch1 Serial");
    LabelAbbreviations available2 = aSettings.getAbbreviations();
    Assert.assertEquals(available2.getAbbreviation("BCA1"), "BCA1");
    Assert.assertEquals(available2.getAbbreviation("Amps"), "Amps");

    // Change the state of the control panel via currentAbbreviations
    LabelAbbreviations currentAbbreviations = new LabelAbbreviations();
    currentAbbreviations.addAbbreviation("Amps", "A | a | Amp");
    currentAbbreviations.addAbbreviation("BCA1", "B | bca1");
    currentAbbreviations.addAbbreviation("CAT", "C");
    currentAbbreviations.addAbbreviation("DOG", "D");
    currentAbbreviations.addAbbreviation("Ace", "ace");
    currentAbbreviations.addAbbreviation("Abb", "a");
    currentAbbreviations.addAbbreviation("Rabbit", "R");

    AbbreviationSettings a2Settings = new AbbreviationSettings("fullLabel", availableAbbreviations, currentAbbreviations);
    LabelAbbreviations available2afterSelect = a2Settings.getAbbreviations();
    Assert.assertEquals(available2afterSelect.getAbbreviation("BCA1"), "B | bca1");
    Assert.assertEquals(available2afterSelect.getAbbreviation("Amps"), "A | a | Amp");
    Map<String, String> map = getAbbreviations(currentAbbreviations);
    Assert.assertEquals(map.size(), 7);
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.table.view.AbbreviationSettings

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.