Search Results

Search found 5671 results on 227 pages for 'final'.

Page 6/227 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Multiple Components in a JTree Node Renderer & Node Editor

    - by Samad Lotia
    I am attempting to create a JTree where a node has several components: a JPanel that holds a JCheckBox, followed by a JLabel, then a JComboBox. I have attached the code at the bottom if one wishes to run it. Fortunately the JTree correctly renders the components. However when I click on the JComboBox, the node disappears; if I click on the JCheckBox, it works fine. It seems that I am doing something wrong with how the TreeCellEditor is being set up. How could I resolve this issue? Am I going beyond the capabilities of JTree? Here's a quick overview of the code I have posted below. The class EntityListDialog merely creates the user interface. It is not useful to understand it other than the createTree method. Node is the data structure that holds information about each node in the JTree. All Nodes have a name, but samples may be null or an empty array. This should be evident by looking at EntityListDialog's createTree method. The name is used as the text of the JCheckBox. If samples is non-empty, it is used as the contents of the JCheckBox. NodeWithSamplesRenderer renders Nodes whose samples are non-empty. It creates the complicated user interface with the JPanel consisting of the JCheckBox and the JComboBox. NodeWithoutSamplesRenderer creates just a JCheckBox when samples is empty. RendererDispatcher decides whether to use a NodeWithSamplesRenderer or a NodeWithoutSamplesRenderer. This entirely depends on whether Node has a non-empty samples member or not. It essentially functions as a means for the NodeWith*SamplesRenderer to plug into the JTree. Code listing: import java.awt.*; import java.awt.event.*; import java.util.*; import javax.swing.*; import javax.swing.tree.*; public class EntityListDialog { final JDialog dialog; final JTree entitiesTree; public EntityListDialog() { dialog = new JDialog((Frame) null, "Test"); entitiesTree = createTree(); JScrollPane entitiesTreeScrollPane = new JScrollPane(entitiesTree); JCheckBox pathwaysCheckBox = new JCheckBox("Do additional searches"); JButton sendButton = new JButton("Send"); JButton cancelButton = new JButton("Cancel"); JButton selectAllButton = new JButton("All"); JButton deselectAllButton = new JButton("None"); dialog.getContentPane().setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JPanel selectPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); selectPanel.add(new JLabel("Select: ")); selectPanel.add(selectAllButton); selectPanel.add(deselectAllButton); c.gridx = 0; c.gridy = 0; c.weightx = 1.0; c.weighty = 0.0; c.fill = GridBagConstraints.HORIZONTAL; dialog.getContentPane().add(selectPanel, c); c.gridx = 0; c.gridy = 1; c.weightx = 1.0; c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.insets = new Insets(0, 5, 0, 5); dialog.getContentPane().add(entitiesTreeScrollPane, c); c.gridx = 0; c.gridy = 2; c.weightx = 1.0; c.weighty = 0.0; c.insets = new Insets(0, 0, 0, 0); c.fill = GridBagConstraints.HORIZONTAL; dialog.getContentPane().add(pathwaysCheckBox, c); JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); buttonsPanel.add(sendButton); buttonsPanel.add(cancelButton); c.gridx = 0; c.gridy = 3; c.weightx = 1.0; c.weighty = 0.0; c.fill = GridBagConstraints.HORIZONTAL; dialog.getContentPane().add(buttonsPanel, c); dialog.pack(); dialog.setVisible(true); } public static void main(String[] args) { EntityListDialog dialog = new EntityListDialog(); } private static JTree createTree() { DefaultMutableTreeNode root = new DefaultMutableTreeNode( new Node("All Entities")); root.add(new DefaultMutableTreeNode( new Node("Entity 1", "Sample A", "Sample B", "Sample C"))); root.add(new DefaultMutableTreeNode( new Node("Entity 2", "Sample D", "Sample E", "Sample F"))); root.add(new DefaultMutableTreeNode( new Node("Entity 3", "Sample G", "Sample H", "Sample I"))); JTree tree = new JTree(root); RendererDispatcher rendererDispatcher = new RendererDispatcher(tree); tree.setCellRenderer(rendererDispatcher); tree.setCellEditor(rendererDispatcher); tree.setEditable(true); return tree; } } class Node { final String name; final String[] samples; boolean selected; int selectedSampleIndex; public Node(String name, String... samples) { this.name = name; this.selected = false; this.samples = samples; if (samples == null) { this.selectedSampleIndex = -1; } else { this.selectedSampleIndex = 0; } } public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } public String toString() { return name; } public int getSelectedSampleIndex() { return selectedSampleIndex; } public void setSelectedSampleIndex(int selectedSampleIndex) { this.selectedSampleIndex = selectedSampleIndex; } public String[] getSamples() { return samples; } } interface Renderer { public void setForeground(final Color foreground); public void setBackground(final Color background); public void setFont(final Font font); public void setEnabled(final boolean enabled); public Component getComponent(); public Object getContents(); } class NodeWithSamplesRenderer implements Renderer { final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(); final JPanel panel = new JPanel(); final JCheckBox checkBox = new JCheckBox(); final JLabel label = new JLabel(" Samples: "); final JComboBox comboBox = new JComboBox(comboBoxModel); final JComponent components[] = {panel, checkBox, comboBox, label}; public NodeWithSamplesRenderer() { Boolean drawFocus = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon"); if (drawFocus != null) { checkBox.setFocusPainted(drawFocus.booleanValue()); } for (int i = 0; i < components.length; i++) { components[i].setOpaque(true); } panel.add(checkBox); panel.add(label); panel.add(comboBox); } public void setForeground(final Color foreground) { for (int i = 0; i < components.length; i++) { components[i].setForeground(foreground); } } public void setBackground(final Color background) { for (int i = 0; i < components.length; i++) { components[i].setBackground(background); } } public void setFont(final Font font) { for (int i = 0; i < components.length; i++) { components[i].setFont(font); } } public void setEnabled(final boolean enabled) { for (int i = 0; i < components.length; i++) { components[i].setEnabled(enabled); } } public void setContents(Node node) { checkBox.setText(node.toString()); comboBoxModel.removeAllElements(); for (int i = 0; i < node.getSamples().length; i++) { comboBoxModel.addElement(node.getSamples()[i]); } } public Object getContents() { String title = checkBox.getText(); String[] samples = new String[comboBoxModel.getSize()]; for (int i = 0; i < comboBoxModel.getSize(); i++) { samples[i] = comboBoxModel.getElementAt(i).toString(); } Node node = new Node(title, samples); node.setSelected(checkBox.isSelected()); node.setSelectedSampleIndex(comboBoxModel.getIndexOf(comboBoxModel.getSelectedItem())); return node; } public Component getComponent() { return panel; } } class NodeWithoutSamplesRenderer implements Renderer { final JCheckBox checkBox = new JCheckBox(); public NodeWithoutSamplesRenderer() { Boolean drawFocus = (Boolean) UIManager.get("Tree.drawsFocusBorderAroundIcon"); if (drawFocus != null) { checkBox.setFocusPainted(drawFocus.booleanValue()); } } public void setForeground(final Color foreground) { checkBox.setForeground(foreground); } public void setBackground(final Color background) { checkBox.setBackground(background); } public void setFont(final Font font) { checkBox.setFont(font); } public void setEnabled(final boolean enabled) { checkBox.setEnabled(enabled); } public void setContents(Node node) { checkBox.setText(node.toString()); } public Object getContents() { String title = checkBox.getText(); Node node = new Node(title); node.setSelected(checkBox.isSelected()); return node; } public Component getComponent() { return checkBox; } } class NoNodeRenderer implements Renderer { final JLabel label = new JLabel(); public void setForeground(final Color foreground) { label.setForeground(foreground); } public void setBackground(final Color background) { label.setBackground(background); } public void setFont(final Font font) { label.setFont(font); } public void setEnabled(final boolean enabled) { label.setEnabled(enabled); } public void setContents(String text) { label.setText(text); } public Object getContents() { return label.getText(); } public Component getComponent() { return label; } } class RendererDispatcher extends AbstractCellEditor implements TreeCellRenderer, TreeCellEditor { final static Color selectionForeground = UIManager.getColor("Tree.selectionForeground"); final static Color selectionBackground = UIManager.getColor("Tree.selectionBackground"); final static Color textForeground = UIManager.getColor("Tree.textForeground"); final static Color textBackground = UIManager.getColor("Tree.textBackground"); final JTree tree; final NodeWithSamplesRenderer nodeWithSamplesRenderer = new NodeWithSamplesRenderer(); final NodeWithoutSamplesRenderer nodeWithoutSamplesRenderer = new NodeWithoutSamplesRenderer(); final NoNodeRenderer noNodeRenderer = new NoNodeRenderer(); final Renderer[] renderers = { nodeWithSamplesRenderer, nodeWithoutSamplesRenderer, noNodeRenderer }; Renderer renderer = null; public RendererDispatcher(JTree tree) { this.tree = tree; Font font = UIManager.getFont("Tree.font"); if (font != null) { for (int i = 0; i < renderers.length; i++) { renderers[i].setFont(font); } } } public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { final Node node = extractNode(value); if (node == null) { renderer = noNodeRenderer; noNodeRenderer.setContents(tree.convertValueToText( value, selected, expanded, leaf, row, false)); } else { if (node.getSamples() == null || node.getSamples().length == 0) { renderer = nodeWithoutSamplesRenderer; nodeWithoutSamplesRenderer.setContents(node); } else { renderer = nodeWithSamplesRenderer; nodeWithSamplesRenderer.setContents(node); } } renderer.setEnabled(tree.isEnabled()); if (selected) { renderer.setForeground(selectionForeground); renderer.setBackground(selectionBackground); } else { renderer.setForeground(textForeground); renderer.setBackground(textBackground); } renderer.getComponent().repaint(); renderer.getComponent().invalidate(); renderer.getComponent().validate(); return renderer.getComponent(); } public Component getTreeCellEditorComponent( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row) { return getTreeCellRendererComponent( tree, value, true, expanded, leaf, row, true); } public Object getCellEditorValue() { return renderer.getContents(); } public boolean isCellEditable(final EventObject event) { if (!(event instanceof MouseEvent)) { return false; } final MouseEvent mouseEvent = (MouseEvent) event; final TreePath path = tree.getPathForLocation( mouseEvent.getX(), mouseEvent.getY()); if (path == null) { return false; } Object node = path.getLastPathComponent(); if (node == null || (!(node instanceof DefaultMutableTreeNode))) { return false; } DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node; Object userObject = treeNode.getUserObject(); return (userObject instanceof Node); } private static Node extractNode(Object value) { if ((value != null) && (value instanceof DefaultMutableTreeNode)) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) value; Object userObject = node.getUserObject(); if ((userObject != null) && (userObject instanceof Node)) { return (Node) userObject; } } return null; } }

    Read the article

  • NullPointerException in generated JSP code calling setJspId()

    - by Dobbo
    I am trying to deploy the Duke's Bank example form the J2EE 5 tutorial on JBoss 7.1.1. I have only used (unaltered) the source, and the standard XML configuration files for deployment, part of the exercise here is to see how I might structure a JSP based project of my own. The exception I get is as follows: ERROR [[jsp]] Servlet.service() for servlet jsp threw exception: java.lang.NullPointerException at javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1858) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final] at org.apache.jsp.main_jsp._jspx_meth_f_005fview_005f0(main_jsp.java:99) at org.apache.jsp.main_jsp._jspService(main_jsp.java:76) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.13.Final.jar:] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jbossweb-7.0.13.Final.jar:] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.13.Final.jar:] at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final] at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:] at java.lang.Thread.run(Thread.java:636) [rt.jar:1.6.0_18] I have not given any JBoss configuration files, the WAR's WEB-INF part looks like this: $ jar tvf build/lib/dukebank-web.war 0 Sat Dec 15 22:00:12 GMT 2012 META-INF/ 123 Sat Dec 15 22:00:10 GMT 2012 META-INF/MANIFEST.MF 0 Sat Dec 15 22:00:12 GMT 2012 WEB-INF/ 2514 Fri Dec 14 14:29:20 GMT 2012 WEB-INF/web.xml 1348 Sat Dec 15 08:19:46 GMT 2012 WEB-INF/dukesBank.tld 7245 Sat Dec 15 08:19:46 GMT 2012 WEB-INF/faces-config.xml 2153 Sat Dec 15 08:19:46 GMT 2012 WEB-INF/tutorial-template.tld 0 Sat Dec 15 22:00:12 GMT 2012 WEB-INF/classes/... The JSP file (main.jsp) that causes this problem is: <f:view> <h:form> <jsp:include page="/template/template.jsp"/> <center> <h3><h:outputText value="#{bundle.Welcome}"/></h3> </center> </h:form> </f:view> The template file it includes: <%@ taglib uri="/WEB-INF/tutorial-template.tld" prefix="tt" %> <%@ page errorPage="/template/errorpage.jsp" %> <%@ include file="/template/screendefinitions.jspf" %> <html> <head> <title> <tt:insert definition="bank" parameter="title"/> </title> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body bgcolor="#ffffff"> <tt:insert definition="bank" parameter="banner"/> <tt:insert definition="bank" parameter="links"/> </body> </html> I will refrain from coping any more files because, as I said at the start I haven't altered any of the files I have used. Many thanks for your help, Steve

    Read the article

  • This code is of chess game. What is represented by 'DISTANCE' in code? [closed]

    - by rajeshverma423
    package chess; public class Evaluate { public static final int PIECE_KING = 0; public static final int PIECE_QUEEN = 1; public static final int PIECE_ROOK = 2; public static final int PIECE_BISHOP = 3; public static final int PIECE_KNIGHT = 4; public static final int PIECE_PAWN = 5; public static final int FULL_BIT_RANK = 4080; public static final int LAZY_MARGIN = 100; public static final int ISOLATED_PENALTY = 10; public static final int DOUBLE_PENALTY = 4; public static final int[] PIECE_VALUE = { 0, 9, 5, 3, 3, 1 }; public static final int[] PASS_PAWN = { 0, 35, 30, 20, 10, 5 }; public static final byte[] DISTANCE = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 0, 0, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7 };

    Read the article

  • Java: initialization problem with private-final-int-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; InitInt(){} public static void main(String[] args) { // I don't want to assign any value. // just initialize it, how? InitInt test = new InitInt(); System.out.println(test.getRight()); // later assiging a value } public int getRight(){return right;} } Initialization problem with Constructor InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } }

    Read the article

  • UrlRewriter.Net with URL with final dot

    - by devio
    I want to use UrlRewriter.Net as described in this blog by ScottGu. In the example below, page.aspx should display a page text stored in the database based on the title= URL parameter. After a couple of tweaks the only remaining issue seems to be that a final dot in the URL causes a 404 a sequence of two dots in the URL causes a 400 Windows 7, IIS 7 with Integrated AppPool, VS2008. Looking at the Failed Request Log, it seems that the UrlRewriter module is called after retrieving the request handler. Can these two issues be fixed, or is there a better replacement for UrlRewriter? (A related question only asks about the 404) Edit: This behavior can even be reproduced on SO, so maybe there is no work-around?

    Read the article

  • Java: design problem with private-final-int-value and empty constructor

    - by HH
    $ javac InitInt.java InitInt.java:7: variable right might not have been initialized InitInt(){} ^ 1 error $ cat InitInt.java import java.util.*; import java.io.*; public class InitInt { private final int right; //DUE to new Klowledge: Design Problem //I think having an empty constructor like this // is an design problem, shall I remove it? What do you think? // When to use an empty constructor? InitInt(){} public static void main(String[] args) { InitInt test = new InitInt(); System.out.println(test.getRight()); } public int getRight(){return right;} } Initialization problem with Constructor InitInt{ // Still the error, "may not be initialized" // How to initialise it? if(snippetBuilder.length()>(charwisePos+25)){ right=charwisePos+25; }else{ right=snippetBuilder.length()-1; } }

    Read the article

  • Finding final/effective web.config values (from inherited configurations)

    - by gregmac
    Are there any apps that can show the final configuration as applied to a particular application directory? What I'm picturing is something along the lines of FireBug's CSS viewer. Basically, it should show the equivalent single web.config file (as if you only had one), with all the values that apply to the directory in question, with each element (or even attribute) annotated with its source (the real .config file it came from). This would greatly help deploying applications into foreign environments (eg, customer sites) where they sometimes have strange configs, that add in global includes (eg, they put the include in machine.config, instead of the web.config for that app) or have allowOverride=false, etc.

    Read the article

  • Final Integration Testing for Q.A.

    - by CalebHC
    A medium sized rails app that our company has been working on is getting close to the end of development and we are going to start doing Q.A. testing on it. We've have been writing unit, functional and integration tests all along and our test coverage is about 99% (even though that really doesn't mean anything). We feel like we have a pretty good test suite but I was wondering if we should be writing final integration tests for every little action we are going to do during our Q.A. process. If so, would using Shoulda or Cucumber be a good idea? We haven't used either of those testing tools yet, but they sound really great. Any ideas or thoughts would be really helpful. Thanks

    Read the article

  • How do I use an internal SSD as a scratch disk for FCP X?

    - by andrewb
    I'm contemplating setting up my MacBook Air as a video editing machine. If I do this, I'll upgrade to a 256 GB SSD, and I should be able to keep around 100 GB or more free for video editing. The video files would of course be stored externally, but save purchasing some expensive Thunderbolt RAID device (which I suppose is gradually becoming more of an option), it will be slow for read/writes. How can I have a set up where I take advantage of my SSD's speed for a scratch disk/cache for FCP X, but still have the TB(s) of storage of externals? I don't want to have to be moving files constantly back and forth, this is about saving time not wasting it.

    Read the article

  • Copy android.R.layout to my project

    - by eric
    Good advice from CommonWare and Steve H but it's not as easy to me as I first thought. Based on their advice I'm trying to copy android.R.layout to my project to ensure consistency. How do you do this? I looked in Eclipse's Package Explorer and under Android 1.5android.jarandroidR.classRlayout and find R$layout.class. Do I copy the code out of there into my own class? From my very limited knowledge of Java, the following code doesn't make much sense: public static final class android.R$layout { // Field descriptor #8 I public static final int activity_list_item = 17367040; // Field descriptor #8 I public static final int browser_link_context_header = 17367054; // Field descriptor #8 I public static final int expandable_list_content = 17367041; // Field descriptor #8 I public static final int preference_category = 17367042; // Field descriptor #8 I public static final int select_dialog_item = 17367057; // Field descriptor #8 I public static final int select_dialog_multichoice = 17367059; // Field descriptor #8 I public static final int select_dialog_singlechoice = 17367058; // Field descriptor #8 I public static final int simple_dropdown_item_1line = 17367050; // Field descriptor #8 I public static final int simple_expandable_list_item_1 = 17367046; // Field descriptor #8 I public static final int simple_expandable_list_item_2 = 17367047; // Field descriptor #8 I public static final int simple_gallery_item = 17367051; // Field descriptor #8 I public static final int simple_list_item_1 = 17367043; // Field descriptor #8 I public static final int simple_list_item_2 = 17367044; // Field descriptor #8 I public static final int simple_list_item_checked = 17367045; // Field descriptor #8 I public static final int simple_list_item_multiple_choice = 17367056; // Field descriptor #8 I public static final int simple_list_item_single_choice = 17367055; // Field descriptor #8 I public static final int simple_spinner_dropdown_item = 17367049; // Field descriptor #8 I public static final int simple_spinner_item = 17367048; // Field descriptor #8 I public static final int test_list_item = 17367052; // Field descriptor #8 I public static final int two_line_list_item = 17367053; // Method descriptor #50 ()V // Stack: 3, Locals: 1 public R$layout(); 0 aload_0 [this] 1 invokespecial java.lang.Object() [1] 4 new java.lang.RuntimeException [2] 7 dup 8 ldc <String "Stub!"> [3] 10 invokespecial java.lang.RuntimeException(java.lang.String) [4] 13 athrow Line numbers: [pc: 0, line: 899] Local variable table: [pc: 0, pc: 14] local: this index: 0 type: android.R.layout Inner classes: [inner class info: #5 android/R$layout, outer class info: #64 android/R inner name: #55 layout, accessflags: 25 public static final] }

    Read the article

  • Hibernate 3.5-Final in JBoss 5.1.0.GA

    - by Bozhidar Batsov
    Hibernate 3.5-Final is finally here and it offers the much anticipated JPA2 support, amongst other features. I am working on a project(EJB3 based) using JBoss 5.1.0.GA and Hibernate 3.3, but I wanted to take advantage of the JPA2 and tried to upgrade to Hibernate 3.5. What I did was fairly simple and standard - I just put all the hibernate 3.5 jars in the server/configuration(default,all,etc)/lib folder - that way they take precedence over the hibernate artifacts shipped with JBoss. It seems though that JBoss ships with libraries that are dependent on the JPA1 implementation part of the hibernate 3.3, because I started getting some errors about unimplemented abstract methods and stuff like that on deploy: 23:21:26,792 WARN [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null. 23:21:26,792 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=kernel-ear-3.3.0-SNAPSHOT.ear/config-persistence.jar#ConfigurationPersistenceUnit state=Create java.lang.AbstractMethodError: org.jboss.jpa.deployment.PersistenceUnitInfoImpl.getValidationMode()Ljavax/persistence/ValidationMode; at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:613) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301) at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source) Maybe I should use a different persistence provided? Currently it's: org.hibernate.ejb.HibernatePersistence I looked around the net and didn't find any documented upgrade paths. There was even an unanswered question here in stack overflow on the topic. Any ideas, suggestions? Thanks in advance for your help.

    Read the article

  • JasperReport Issue using with struts2 - getting null in final PDF file

    - by Nirmal
    Hello, i am writing my jasper report problem with struts2. Following is the code that i am trying to execute : struts.xml contains : <action name="myJasperTest1" class="temp.JasperAction1"> <result name="success" type="jasper"> <param name="location">/jasper/our_compiled_template.jasper</param> <param name="dataSource">myList</param> <param name="format">PDF</param> </result> </action> My JasperAction1 contains : import java.util.ArrayList; import java.util.List; import com.sufalam.business.model.util.LegacyJasperInputStream; import net.sf.jasperreports.engine.JasperCompileManager; import com.opensymphony.xwork2.ActionSupport; import com.sufalam.business.finance.model.bean.Account; import java.io.FileInputStream; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; public class JasperAction1 extends ActionSupport { /** List to use as our JasperReports dataSource. */ private List<Account> myList; public String execute() throws Exception { // Create some imaginary persons. Account a1 = new Account(); Account a2 = new Account(); a1.setId(77); a1.setName("aaa"); a2.setId(88); a2.setName("bbb"); // Store people in our dataSource list (normally would come from database). myList = new ArrayList<Account>(); myList.add(a1); myList.add(a2); // Normally we would provide a pre-compiled .jrxml file // or check to make sure we don't compile on every request. try { JasperDesign design = JRXmlLoader.load( new LegacyJasperInputStream(new FileInputStream("F://backup//backup 26-5(final acegi)//SufalamERP//build//web//jasper//report2.jrxml"))); JasperCompileManager.compileReportToFile(design,"F://backup//backup 26-5(final acegi)//SufalamERP//build//web//jasper//our_compiled_template1.jasper"); } catch (Exception e) { e.printStackTrace(); return ERROR; } return SUCCESS; } public List<Account> getMyList() { return myList; } } I am using ireport plugin of Netbeans for generation .jrxml file. After Designing my page using IReport wizard my our_jasper_template.jrxml file contains following code : <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <queryString language="SQL"> <![CDATA[SELECT account_master."name" AS account_master_name, account_master."id" AS account_master_id FROM "public"."account_master" account_master]]> </queryString> <field name="account_master_name" class="java.lang.String"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <field name="account_master_id" class="java.lang.Integer"> <fieldDescription><![CDATA[]]></fieldDescription> </field> <background> <band/> </background> <title> <band height="58"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="65" y="13" width="424" height="35"/> <textElement textAlignment="Center"> <font size="26" isBold="true"/> </textElement> <text><![CDATA[Classic template]]></text> </staticText> </band> </title> <pageHeader> <band/> </pageHeader> <columnHeader> <band/> </columnHeader> <detail> <band height="40"> <staticText> <reportElement x="0" y="0" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_name]]></text> </staticText> <textField> <reportElement x="139" y="0" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{account_master_name}]]></textFieldExpression> </textField> <staticText> <reportElement x="0" y="20" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_id]]></text> </staticText> <textField> <reportElement x="139" y="20" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{account_master_id}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band/> </columnFooter> <pageFooter> <band height="26"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Right"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band/> </summary> </jasperReport> Now the problem i am facing is when i execute this action class it gives me following output as pdf format :

    Read the article

  • Computer science final year project ideas

    - by roul
    I'm a Computer Science undergraduate student in UK and should be deciding the subject of my final year project soon. The school is pretty flexible with the subject... "The topic can be any area of the subject which is of mutual interest to both the student and supervisor. Topics can range from purely theoretical studies to practical work building a system for some third party, although most projects aim to provide a balance between the theoretical and practical aspects of the subject." ...so I'm a bit lost since I want to do something in software engineering but have no idea what (subject) or with what (languages)! :) a) Languages: I've had experience with Java, C# and ASP.NET mostly but I would definitely be interested in learning new languages/frameworks. I'm kind of drawn by the idea of dynamic languages at the moment so IronPython seems likely. b) Subject: Anything that will keep me interested through the year and will give me the opportunity to learn a lot of stuff. Maybe something that has to do with music, or a fancy website, or a website about music :P anything really. Open to any thoughts/ideas, geeky or cool! Edit: Professors do usually supervise projects in their research areas but I currently have the choice to approach any of them according to my interest - whatever that is.

    Read the article

  • ListView Final Column Autosize creates scrollbar

    - by Courtney de Lautour
    Hi There, I am implementing a custom control which derives from ListView. I would like for the final column to fill the remaining space (Quite a common task), I have gone about this via overriding the OnResize method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (Columns.Count == 0) return; Columns[Columns.Count - 1].Width = -2; // -2 = Fill remaining space } or via another method: protected override void OnResize(EventArgs e) { base.OnResize(e); if (!_autoFillLastColumn) return; if (Columns.Count == 0) return; int TotalWidth = 0; int i = 0; for (; i < Columns.Count - 1; i++) { TotalWidth += Columns[i].Width; } Columns[i].Width = this.DisplayRectangle.Width - TotalWidth; } Edit: This works fine until I dock the ListView into a parent container and resize via that control. Every second time the control size shrinks (IE, drag the the border one pixel), I get a scroll bar on the bottom which can't move at all (not even one pixel). The result of which is when I drag the size of the parent I am left with a flickering scroll bar in the ListView, and a 50% chance it will be there when the dragging stops.

    Read the article

  • jQuery Cycle - #next #prev, goto nextGallery after final slide of currentGallery

    - by FHP
    I am using jQuery cycle in several galleries with #next #prev navigation and a image counter output. Now I am trying to connect all these galleries together. If the user reaches the final slide of gallery A (galleryA.html), the #next anchor should point to gallery B (galleryB.html) / the #prev anchor should point to gallery C (galleryC.html). How can I combine my 2 functions to do that? // slideshow fx $(function() { $('#slideshow').cycle({ fx: 'fade', speed: 350, prev: '#prev', next: '#next', timeout: 0, after: onAfter }); }); //image counter output function onAfter(curr,next,opts) { var caption = (opts.currSlide + 1) + opts.slideCount; $('#counter').html(caption); } html: <div id="slideshow-container"> <div class="slideshow-nav"><a id="prev" href=""></a></div> <div class="slideshow-nav"><a id="next" href=""></a></div> <div id="slideshow" class="pics"> <img src="galleryA/01.jpg" /> <img src="galleryA/02.jpg" /> <img src="galleryA/03.jpg" /> <img src="galleryA/04.jpg" /> <img src="galleryA/05.jpg" /> <img src="galleryA/06.jpg" /> </div> </div>

    Read the article

  • VS2010 final does only link project on "rebuild all", not on "build changed"

    - by Sam
    I've just migrated a solution containing c++ and c# projects from VS2008 to VS2010 and got a strange problem. When I select "rebuild all", everything compiles and links as I would expect it to do. Then I change some c++ source file (just add a space), build the project, I get several thousands of linking errors like these: GDlgPackerListe.obj : error LNK2028: Nicht aufgelöstes Token (0A0000C7) ""public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z)", auf das in Funktion ""public: virtual void __thiscall LRcPackerListe::HookRunReport(class LFortschritt &)" (?HookRunReport@LRcPackerListe@@$$FUAEXAAVLFortschritt@@@Z)" verwiesen wird. Db_Lieferschein2.obj : error LNK2020: Nicht aufgelöstes Token (0A0000E6) "public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z). bmed.obj : error LNK2028: Nicht aufgelöstes Token (0A00014D) ""public: bool __thiscall LList::Add(class LBString const &)" (?Add@LList@@$$FQAE_NABVLBString@@@Z)", auf das in Funktion ""public: virtual long __thiscall MENUKB::Methode(long,long)" (?Methode@MENUKB@@$$FUAEJJJ@Z)" verwiesen wird. GDlgPackerListe.obj : error LNK2028: Nicht aufgelöstes Token (0A0000C9) ""public: void __thiscall LList::Sort(void)" (?Sort@LList@@$$FQAEXXZ)", auf das in Funktion ""public: virtual void __thiscall LRcPackerListe::HookRunReport(class LFortschritt &)" (?HookRunReport@LRcPackerListe@@$$FUAEXAAVLFortschritt@@@Z)" verwiesen wird. Dlg_Gutschrift.obj : error LNK2020: Nicht aufgelöstes Token (0A000128) "public: virtual __thiscall LBaseType::~LBaseType(void)" (??1LBaseType@@$$FUAE@XZ). Module_Damals.lib(svSuchAltLink.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall SView::SView(void)" (??0SView@@QAE@XZ)". Module_Damals.lib(svShowEMF.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""public: virtual void __thiscall SView::HookValueChanged(unsigned __int64)" (?HookValueChanged@SView@@UAEX_K@Z)". When I hit "rebuild all" it recompiles and links without any errors or even warnings and produces a working exe. I'm using Visual Studio 2010 final (german edition). Whats going on here? Or, more important: how do I get the linker to work correctly??

    Read the article

  • What's a reasonable way to mutate a primitive variable from an anonymous Java class?

    - by Steve
    I would like to write the following code: boolean found = false; search(new SearchCallback() { @Override void onFound(Object o) { found = true; } }); Obviously this is not allowed, since found needs to be final. I can't make found a member field for thread-safety reasons. What is the best alternative? One workaround is to define final class MutableReference<T> { private T value; MutableReference(T value) { this.value = value; } T get() { return value; } void set(T value) { this.value = value; } } but this ends up taking a lot of space when formatted properly, and I'd rather not reinvent the wheel if at all possible. I could use a List<Boolean> with a single element (either mutating that element, or else emptying the list) or even a Boolean[1]. But everything seems to smell funny, since none of the options are being used as they were intended. What is a reasonable way to do this?

    Read the article

  • Why is there no Constant keyword in Java?

    - by harigm
    I am curious learner of Java, and I was thinking about the topic of "CONSTANTS". I have learnt that Java allows us to declare constants by using final keyword. My question is why didn't Java introduce Constant (const) keyword. Since many people say it has come from C++, in C++ we have const keyword. Please share your thoughts.

    Read the article

  • Why Constant Keyword is not introduced In Java?

    - by harigm
    I am curious learner of Java, I was thinking on one topic "CONSTANTS" I have learnt that Java allows us to declare constants by using "Final" keyword. My question is Java didnot introduce Constant(Const) Keyword. Since many people say it has come from C++, in C++ we have Const keyword Is there any strong reason behind, Please share your thoughts on this.

    Read the article

  • Why opening Ubuntu's default wallpaper (warty-final-ubuntu.png) in Image Viewer always fails?

    - by Kush
    Everytime I try to open Ubuntu (any version, since from 8.04 with which I started) default wallpaper, named "warty-final-ubuntu.png", I get the following error. I have also reported bug for the same, more than a year ago but it is still unresolved. Also I don't get the point why the default wallpaper is still named as "warty-final-ubuntu.png" instead of having actual code name prefix to which wallpaper belongs eg. "precise-final-ubuntu.png" and so on. General Thoughts Lots of community effort goes under development of this marvelous distribution but we're still missing out to fix such silly issues, which is directly/indirectly affecting the number of new adopters.

    Read the article

  • Is there any complications or side effects for changing final field access/visibility modifier from private to protected?

    - by Software Engeneering Learner
    I have a private final field in one class and then I want to address that field in a subclass. I want to change field access/visibility modifier from private to protected, so I don't have to call getField() method from subclass and I can instead address that field directly (which is more clear and cohessive). Will there be any side effects or complications if I change private to protected for a final field? UPDATE: from logical point of view, it's obvious that descendant should be able to directly access all predecessor fields, right? But there are certain constraints that are imposed on private final fields by JVM, like 100% initialization guarantee after construction phase(useful for concurrency) and so on. So I would like to know, by changing from private to protected, won't that or any other constraints be compromised?

    Read the article

  • Implementing Clonable in Java

    - by Artium
    In which cases should I use this way: public A clone() throws CloneNotSupportedException { A clone = (A)super.clone(); clone.x= this.x; return clone; } And in which cases should I use that way: public ShiftedStack clone() throws CloneNotSupportedException { return new A(this.x); } What should I do if x is final and I want to use the first way? Regarding the first way, I understand it like this: we clone the super class and up-cast it, leading to some members uninitialized. After this initialize these members. Is my understanding correct? Thank you.

    Read the article

  • hierachical query to return final row

    - by jeff
    I have a hierarchical query that doesn't return an expected row (employee badge = 444). TABLE: hr_data badge fname supervisor_badge 111 Jeff 222 222 Joe 333 333 John 444 444 Tom 444 SQL: SELECT CONNECT_BY_ISCYCLE As IC, badge, fname, supervisor_badge FROM hr_data START WITH badge = '111' CONNECT BY NOCYCLE badge = PRIOR supervisor_badge What is Returned: IC badge fname supervisor_badge 0 111 Jeff 222 0 222 Joe 333 1 333 John 444 What is Expected: IC badge fname supervisor_badge 0 111 Jeff 222 0 222 Joe 333 **0** 333 John 444 **1** 444 Tom 444 How can I get this query to return the employee Tom and then stop?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >