Example usage for java.lang Boolean TRUE

List of usage examples for java.lang Boolean TRUE

Introduction

In this page you can find the example usage for java.lang Boolean TRUE.

Prototype

Boolean TRUE

To view the source code for java.lang Boolean TRUE.

Click Source Link

Document

The Boolean object corresponding to the primitive value true .

Usage

From source file:Main.java

public Main() {
    Vector model = new Vector();
    model.addElement(new Item(1, "A"));
    model.addElement(new Item(2, "B"));
    model.addElement(new Item(3, "C"));
    model.addElement(new Item(4, "D"));

    JComboBox comboBox = new JComboBox(model);
    comboBox.addActionListener(this);
    comboBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    getContentPane().add(comboBox, BorderLayout.NORTH);

    comboBox = new JComboBox(model);
    comboBox.setRenderer(new ItemRenderer());
    comboBox.addActionListener(this);
    getContentPane().add(comboBox, BorderLayout.SOUTH);
}

From source file:Main.java

public static void writeDocument(Document doc, Writer out) throws IOException {
    // happy to replace this code w/ the non-deprecated code, but I couldn't get the transformer 
    // approach to work. 
    //    OutputFormat format = new OutputFormat(doc);
    //    format.setIndenting(true);
    //    format.setIndent(2);
    //    XMLSerializer serializer = new XMLSerializer(out, format);
    //    serializer.serialize(doc);

    DOMImplementationLS impl = (DOMImplementationLS) doc.getImplementation();
    LSSerializer writer = impl.createLSSerializer();
    DOMConfiguration config = writer.getDomConfig();

    if (config.canSetParameter("format-pretty-print", Boolean.TRUE)) {
        config.setParameter("format-pretty-print", Boolean.TRUE);
    }//www.j  a v  a2s. c o  m

    // what a crappy way to force the stream to be UTF-8.  yuck!
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    LSOutput output = impl.createLSOutput();
    output.setEncoding("UTF-8");
    output.setByteStream(baos);

    writer.write(doc, output);

    out.write(baos.toString());
    out.flush();
}

From source file:Main.java

public static String prettyPrint(Document document) {
    // Pretty-prints a DOM document to XML using DOM Load and Save's
    // LSSerializer.
    // Note that the "format-pretty-print" DOM configuration parameter can
    // only be set in JDK 1.6+.

    DOMImplementationRegistry domImplementationRegistry;
    try {//from w  ww.j av  a 2 s . com
        domImplementationRegistry = DOMImplementationRegistry.newInstance();
    } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | ClassCastException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
        throw new RuntimeException(e);
    }
    DOMImplementation domImplementation = document.getImplementation();
    if (domImplementation.hasFeature("LS", "3.0") && domImplementation.hasFeature("Core", "2.0")) {
        /*DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementation
          .getFeature("LS", "3.0");*/
        DOMImplementationLS domImplementationLS = (DOMImplementationLS) domImplementationRegistry
                .getDOMImplementation("LS");

        LSSerializer lsSerializer = domImplementationLS.createLSSerializer();
        DOMConfiguration domConfiguration = lsSerializer.getDomConfig();
        if (domConfiguration.canSetParameter("format-pretty-print", Boolean.TRUE)) {
            lsSerializer.getDomConfig().setParameter("format-pretty-print", Boolean.TRUE);
            LSOutput lsOutput = domImplementationLS.createLSOutput();
            lsOutput.setEncoding("UTF-8");
            StringWriter stringWriter = new StringWriter();
            lsOutput.setCharacterStream(stringWriter);
            lsSerializer.write(document, lsOutput);
            return stringWriter.toString();
        } else {
            throw new RuntimeException("DOMConfiguration 'format-pretty-print' parameter isn't settable.");
        }
    } else {
        throw new RuntimeException("DOM 3.0 LS and/or DOM 2.0 Core not supported.");
    }
}

From source file:org.panksdmz.jms.tibco.soapws.TibcoSpringSenderTest.java

@Test
public void test() throws Exception {
    System.out.println("TibcoJMSTest");
    while (Boolean.TRUE) {
        Thread.sleep(100);/*w w w.j  av a  2s .  c o  m*/
    }
}

From source file:com.inkubator.hrm.util.StringsUtils.java

public static boolean isHaveNumber(String toCheck) {
    Boolean isCondition = Boolean.FALSE;
    for (int i = toCheck.length() - 1; i >= 0; i--) {

        if (Character.isDigit(toCheck.charAt(i))) {
            isCondition = Boolean.TRUE;
        }/*from   w w  w . j a  va  2 s . c om*/
    }
    return isCondition;
}

From source file:boutique.service.ConnectionService.java

public void connection(String email, String mdp) throws ErreurMotDePasseOuEmailException {

    Utilisateur u = utilisateurService.findByEmailAndMdp(email, mdp);

    if (u == null) {
        throw new ErreurMotDePasseOuEmailException();
    }//from w w  w  .  ja  va2  s .  c  om
    u.setConnecte(Boolean.TRUE);
    System.out.println("Bienvenue " + u.getPrenom());

}

From source file:Main.java

@Override
public Boolean queryFrom(TemporalAccessor temporal) {
    if (temporal.isSupported(ChronoField.DAY_OF_MONTH) && temporal.isSupported(ChronoField.DAY_OF_WEEK)) {
        int dayOfMonth = temporal.get(ChronoField.DAY_OF_MONTH);
        int weekDay = temporal.get(ChronoField.DAY_OF_WEEK);
        DayOfWeek dayOfWeek = DayOfWeek.of(weekDay);
        if (dayOfMonth == 1 && dayOfWeek == DayOfWeek.MONDAY) {
            return Boolean.TRUE;
        }//w w  w .ja  v a 2  s . c o  m
    }
    return Boolean.FALSE;
}

From source file:net.firejack.aws.license.LicenseHelper.java

public static File create(License license) throws IOException, NoSuchAlgorithmException, JAXBException {
    signature(license);/*w w w . j  a v  a2s . co m*/

    File tmp = new File("/tmp/", license.getName() + ".xml");

    tmp.getParentFile().mkdirs();
    tmp.createNewFile();
    FileOutputStream stream = new FileOutputStream(tmp);

    JAXBContext jaxbContext = JAXBContext.newInstance(License.class);
    Marshaller marshaller = jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.marshal(license, stream);
    stream.close();

    return tmp;
}

From source file:com.tamnd.app.rest.resources.AccountResource.java

public Account toAccount() {
    Account account = new Account();
    account.setUserName(userName);// w  ww.  j av a 2  s .  c  o  m
    account.setPassword(password);
    account.setEnable(Boolean.TRUE);
    account.setUserRole(getRoles());
    return account;
}

From source file:au.org.emii.geoserver.extensions.filters.layer.data.Filter.java

public Filter(String name, String type) {
    this.name = name;
    this.type = type;
    this.enabled = Boolean.FALSE;
    this.visualised = Boolean.TRUE;
    this.excludedFromDownload = Boolean.FALSE;
    this.extras = new HashMap<String, String>();
}