List of usage examples for java.lang Boolean Boolean
@Deprecated(since = "9") public Boolean(String s)
From source file:org.myjerry.evenstar.web.blog.DeleteCommentController.java
public ModelAndView deleteComment(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView mav = new ModelAndView(); String postID = request.getParameter("postID"); String blogID = request.getParameter("blogID"); String commentID = request.getParameter("commentID"); String postURL = request.getParameter("postURL"); boolean result = this.commentService.deleteComment(StringUtils.getLong(commentID), StringUtils.getLong(postID), StringUtils.getLong(blogID)); if (!result) { mav = view(request, response);/*from w ww .j a v a 2 s . c o m*/ } else { mav.addObject("postURL", "/index.html"); } mav.addObject("postURL", postURL); mav.addObject("result", new Boolean(result)); mav.setViewName(".delete.comment"); return mav; }
From source file:com.sshtools.sshterm.FullScreenAction.java
public FullScreenAction(SshToolsApplication application, SshToolsApplicationContainer container) { this.application = application; this.container = container; putValue(Action.NAME, NAME_FULL_SCREEN); putValue(Action.SMALL_ICON, getIcon(SMALL_ICON_FULL_SCREEN)); putValue(LARGE_ICON, getIcon(LARGE_ICON_FULL_SCREEN)); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK)); putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION_FULL_SCREEN); putValue(Action.LONG_DESCRIPTION, LONG_DESCRIPTION_FULL_SCREEN); putValue(Action.MNEMONIC_KEY, new Integer(MNEMONIC_KEY_FULL_SCREEN)); putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND_KEY_FULL_SCREEN); putValue(StandardAction.ON_MENUBAR, new Boolean(true)); putValue(StandardAction.MENU_NAME, "View"); putValue(StandardAction.MENU_ITEM_GROUP, new Integer(20)); putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(20)); putValue(StandardAction.ON_TOOLBAR, new Boolean(true)); putValue(StandardAction.TOOLBAR_GROUP, new Integer(5)); putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(30)); }
From source file:gr.open.loglevelsmanager.loglevel.LogLevelUpload.java
public void addDeleted(String formField) { if (deleteds == null) deleteds = new HashMap(); deleteds.put(formField, new Boolean("true")); }
From source file:com.sshtools.powervnc.VncFullScreenAction.java
public VncFullScreenAction(SshToolsApplication application, SshToolsApplicationContainer container) { this.application = application; this.container = container; putValue(Action.NAME, NAME_FULL_SCREEN); putValue(Action.SMALL_ICON, getIcon(SMALL_ICON_FULL_SCREEN)); putValue(LARGE_ICON, getIcon(LARGE_ICON_FULL_SCREEN)); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK)); putValue(Action.SHORT_DESCRIPTION, SHORT_DESCRIPTION_FULL_SCREEN); putValue(Action.LONG_DESCRIPTION, LONG_DESCRIPTION_FULL_SCREEN); putValue(Action.MNEMONIC_KEY, new Integer(MNEMONIC_KEY_FULL_SCREEN)); putValue(Action.ACTION_COMMAND_KEY, ACTION_COMMAND_KEY_FULL_SCREEN); putValue(StandardAction.ON_MENUBAR, new Boolean(true)); putValue(StandardAction.MENU_NAME, "View"); putValue(StandardAction.MENU_ITEM_GROUP, new Integer(20)); putValue(StandardAction.MENU_ITEM_WEIGHT, new Integer(20)); putValue(StandardAction.ON_TOOLBAR, new Boolean(true)); putValue(StandardAction.TOOLBAR_GROUP, new Integer(5)); putValue(StandardAction.TOOLBAR_WEIGHT, new Integer(30)); }
From source file:com.sourcesense.ant.dbdep.task.dao.DbDepDao.java
private boolean existDependency(final DependencyDO dependency) { Boolean result = new Boolean(false); try {/* w ww. j a v a2s . c o m*/ result = (Boolean) this.jdbcTemplate.query(psSelect, new PreparedStatementSetter() { public void setValues(java.sql.PreparedStatement ps) throws java.sql.SQLException { ps.setString(1, dependency.getProject()); ps.setString(2, dependency.getEnvironment()); ps.setString(3, dependency.getName()); ps.setString(4, dependency.getVersion()); }; }, new ResultSetExtractor() { public Object extractData(ResultSet rs) throws SQLException, DataAccessException { if (rs != null && rs.next()) return new Boolean(true); else return new Boolean(false); } }); } catch (DataAccessException e) { log.error("Error during checking dependency on this query: " + "" + psSelect + " | dependency: " + dependency, e); throw new RuntimeException("Error during checking dependency on this query: " + "" + psSelect + " | dependency: " + dependency, e); } return result.booleanValue(); }
From source file:components.SimpleTableSelectionDemo.java
public SimpleTableSelectionDemo() { super(new GridLayout(1, 0)); final String[] columnNames = { "First Name", "Last Name", "Sport", "# of Years", "Vegetarian" }; final Object[][] data = { { "Kathy", "Smith", "Snowboarding", new Integer(5), new Boolean(false) }, { "John", "Doe", "Rowing", new Integer(3), new Boolean(true) }, { "Sue", "Black", "Knitting", new Integer(2), new Boolean(false) }, { "Jane", "White", "Speed reading", new Integer(20), new Boolean(true) }, { "Joe", "Brown", "Pool", new Integer(10), new Boolean(false) } }; final JTable table = new JTable(data, columnNames); table.setPreferredScrollableViewportSize(new Dimension(500, 70)); table.setFillsViewportHeight(true);// w ww.jav a2 s.c o m table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); if (ALLOW_ROW_SELECTION) { // true by default ListSelectionModel rowSM = table.getSelectionModel(); rowSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) { System.out.println("No rows are selected."); } else { int selectedRow = lsm.getMinSelectionIndex(); System.out.println("Row " + selectedRow + " is now selected."); } } }); } else { table.setRowSelectionAllowed(false); } if (ALLOW_COLUMN_SELECTION) { // false by default if (ALLOW_ROW_SELECTION) { //We allow both row and column selection, which //implies that we *really* want to allow individual //cell selection. table.setCellSelectionEnabled(true); } table.setColumnSelectionAllowed(true); ListSelectionModel colSM = table.getColumnModel().getSelectionModel(); colSM.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { //Ignore extra messages. if (e.getValueIsAdjusting()) return; ListSelectionModel lsm = (ListSelectionModel) e.getSource(); if (lsm.isSelectionEmpty()) { System.out.println("No columns are selected."); } else { int selectedCol = lsm.getMinSelectionIndex(); System.out.println("Column " + selectedCol + " is now selected."); } } }); } if (DEBUG) { table.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { printDebugData(table); } }); } //Create the scroll pane and add the table to it. JScrollPane scrollPane = new JScrollPane(table); //Add the scroll pane to this panel. add(scrollPane); }
From source file:com.netflix.simianarmy.janitor.TestBasicJanitorMonkeyContext.java
@Test public void testAddRuleWithoutUntaggedRuleResource() { JanitorRuleEngine ruleEngine = new BasicJanitorRuleEngine(); Boolean untaggedRuleEnabled = new Boolean(true); Rule rule = new UntaggedRule(monkeyCalendar, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_REQUIREDTAGS, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOWNER, SIMIANARMY_JANITOR_RULE_UNTAGGEDRULE_RETENTIONDAYSWITHOUTOWNER); if (untaggedRuleEnabled && getUntaggedRuleResourceSet().contains("ASG")) { ruleEngine.addRule(rule);//from w w w. j av a 2 s . c o m } Assert.assertFalse(ruleEngine.getRules().contains(rule)); }
From source file:com.brsanthu.dataexporter.DataExporterTestBase.java
protected void addData() { exporter.addRow(new Date(dateReference - 2397984), new Integer(1), "Laptop", new Boolean(false), new Integer(1), new Double(799.78)); exporter.addRow(new Date(dateReference - 232042098), new Integer(2), "Mouse", new Boolean(true), new Integer(2), new Double(49.30)); exporter.addRow(new Date(dateReference - 234084277), new Integer(3), "Keyboard", new Boolean(false), new Integer(5), new Double(75)); }
From source file:main.java.refinement_class.Useful.java
public static String mashal2(Object o, Class c) { Marshaller marshaller;//from w w w . j av a 2s .c om // create a JAXBContext JAXBContext jaxbContext; String xmlString = ""; try { jaxbContext = JAXBContext.newInstance(c); marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean(true)); // marshaller.marshal(o, new FileOutputStream(xml_file)); StringWriter sw = new StringWriter(); marshaller.marshal(o, sw); xmlString = sw.toString(); } catch (JAXBException e) { e.printStackTrace(); } return xmlString; }
From source file:com.sourcesense.maven.dbdep.plugin.dao.DbDependenciesDao.java
/** * /*from w w w.j a v a2 s . c o m*/ * @param dependency * @return TRUE if dependency exist */ private boolean existDependency(final DependencyDO dependency) { Boolean result = new Boolean(false); try { result = (Boolean) this.jdbcTemplate.query(psSelect, new PreparedStatementSetter() { public void setValues(java.sql.PreparedStatement ps) throws java.sql.SQLException { ps.setString(1, dependency.getProject()); ps.setString(2, dependency.getEnvironment()); ps.setString(3, dependency.getName()); ps.setString(4, dependency.getVersion()); }; }, new ResultSetExtractor() { public Object extractData(ResultSet rs) throws SQLException, DataAccessException { if (rs != null && rs.next()) return new Boolean(true); else return new Boolean(false); } }); } catch (DataAccessException e) { log.error("Error during checking this dependency: " + dependency, e); throw new RuntimeException("Error during checking this dependency: " + dependency, e); } return result.booleanValue(); }