Search Results

Search found 5349 results on 214 pages for 'override'.

Page 11/214 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How to Implement Project Type "Copy", "Move", "Rename", and "Delete"

    - by Geertjan
    You've followed the NetBeans Project Type Tutorial and now you'd like to let the user copy, move, rename, and delete the projects conforming to your project type. When they right-click a project, they should see the relevant menu items and those menu items should provide dialogs for user interaction, followed by event handling code to deal with the current operation. Right now, at the end of the tutorial, the "Copy" and "Delete" menu items are present but disabled, while the "Move" and "Rename" menu items are absent: The NetBeans Project API provides a built-in mechanism out of the box that you can leverage for project-level "Copy", "Move", "Rename", and "Delete" actions. All the functionality is there for you to use, while all that you need to do is a bit of enablement and configuration, which is described below. To get started, read the following from the NetBeans Project API: http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/ActionProvider.html http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/CopyOperationImplementation.html http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/MoveOrRenameOperationImplementation.html http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/DeleteOperationImplementation.html Now, let's do some work. For each of the menu items we're interested in, we need to do the following: Provide enablement and invocation handling in an ActionProvider implementation. Provide appropriate OperationImplementation classes. Add the new classes to the Project Lookup. Make the Actions visible on the Project Node. Run the application and verify the Actions work as you'd like. Here we go: Create an ActionProvider. Here you specify the Actions that should be supported, the conditions under which they should be enabled, and what should happen when they're invoked, using lots of default code that lets you reuse the functionality provided by the NetBeans Project API: class CustomerActionProvider implements ActionProvider { @Override public String[] getSupportedActions() { return new String[]{ ActionProvider.COMMAND_RENAME, ActionProvider.COMMAND_MOVE, ActionProvider.COMMAND_COPY, ActionProvider.COMMAND_DELETE }; } @Override public void invokeAction(String string, Lookup lkp) throws IllegalArgumentException { if (string.equalsIgnoreCase(ActionProvider.COMMAND_RENAME)) { DefaultProjectOperations.performDefaultRenameOperation( CustomerProject.this, ""); } if (string.equalsIgnoreCase(ActionProvider.COMMAND_MOVE)) { DefaultProjectOperations.performDefaultMoveOperation( CustomerProject.this); } if (string.equalsIgnoreCase(ActionProvider.COMMAND_COPY)) { DefaultProjectOperations.performDefaultCopyOperation( CustomerProject.this); } if (string.equalsIgnoreCase(ActionProvider.COMMAND_DELETE)) { DefaultProjectOperations.performDefaultDeleteOperation( CustomerProject.this); } } @Override public boolean isActionEnabled(String command, Lookup lookup) throws IllegalArgumentException { if ((command.equals(ActionProvider.COMMAND_RENAME))) { return true; } else if ((command.equals(ActionProvider.COMMAND_MOVE))) { return true; } else if ((command.equals(ActionProvider.COMMAND_COPY))) { return true; } else if ((command.equals(ActionProvider.COMMAND_DELETE))) { return true; } return false; } } Importantly, to round off this step, add "new CustomerActionProvider()" to the "getLookup" method of the project. If you were to run the application right now, all the Actions we're interested in would be enabled (if they are visible, as described in step 4 below) but when you invoke any of them you'd get an error message because each of the DefaultProjectOperations above looks in the Lookup of the Project for the presence of an implementation of a class for handling the operation. That's what we're going to do in the next step. Provide Implementations of Project Operations. For each of our operations, the NetBeans Project API lets you implement classes to handle the operation. The dialogs for interacting with the project are provided by the NetBeans project system, but what happens with the folders and files during the operation can be influenced via the operations. Below are the simplest possible implementations, i.e., here we assume we want nothing special to happen. Each of the below needs to be in the Lookup of the Project in order for the operation invocation to succeed. private final class CustomerProjectMoveOrRenameOperation implements MoveOrRenameOperationImplementation { @Override public List<FileObject> getMetadataFiles() { return new ArrayList<FileObject>(); } @Override public List<FileObject> getDataFiles() { return new ArrayList<FileObject>(); } @Override public void notifyRenaming() throws IOException { } @Override public void notifyRenamed(String nueName) throws IOException { } @Override public void notifyMoving() throws IOException { } @Override public void notifyMoved(Project original, File originalPath, String nueName) throws IOException { } } private final class CustomerProjectCopyOperation implements CopyOperationImplementation { @Override public List<FileObject> getMetadataFiles() { return new ArrayList<FileObject>(); } @Override public List<FileObject> getDataFiles() { return new ArrayList<FileObject>(); } @Override public void notifyCopying() throws IOException { } @Override public void notifyCopied(Project prjct, File file, String string) throws IOException { } } private final class CustomerProjectDeleteOperation implements DeleteOperationImplementation { @Override public List<FileObject> getMetadataFiles() { return new ArrayList<FileObject>(); } @Override public List<FileObject> getDataFiles() { return new ArrayList<FileObject>(); } @Override public void notifyDeleting() throws IOException { } @Override public void notifyDeleted() throws IOException { } } Also make sure to put the above methods into the Project Lookup. Check the Lookup of the Project. The "getLookup()" method of the project should now include the classes you created above, as shown in bold below: @Override public Lookup getLookup() { if (lkp == null) { lkp = Lookups.fixed(new Object[]{ this, new Info(), new CustomerProjectLogicalView(this), new CustomerCustomizerProvider(this), new CustomerActionProvider(), new CustomerProjectMoveOrRenameOperation(), new CustomerProjectCopyOperation(), new CustomerProjectDeleteOperation(), new ReportsSubprojectProvider(this), }); } return lkp; } Make Actions Visible on the Project Node. The NetBeans Project API gives you a number of CommonProjectActions, including for the actions we're dealing with. Make sure the items in bold below are in the "getActions" method of the project node: @Override public Action[] getActions(boolean arg0) { return new Action[]{ CommonProjectActions.newFileAction(), CommonProjectActions.copyProjectAction(), CommonProjectActions.moveProjectAction(), CommonProjectActions.renameProjectAction(), CommonProjectActions.deleteProjectAction(), CommonProjectActions.customizeProjectAction(), CommonProjectActions.closeProjectAction() }; } Run the Application. When you run the application, you should see this: Let's now try out the various actions: Copy. When you invoke the Copy action, you'll see the dialog below. Provide a new project name and location and then the copy action is performed when the Copy button is clicked below: The message you see above, in red, might not be relevant to your project type. When you right-click the application and choose Branding, you can find the string in the Resource Bundles tab, as shown below: However, note that the message will be shown in red, no matter what the text is, hence you can really only put something like a warning message there. If you have no text at all, it will also look odd.If the project has subprojects, the copy operation will not automatically copy the subprojects. Take a look here and here for similar more complex scenarios. Move. When you invoke the Move action, the dialog below is shown: Rename. The Rename Project dialog below is shown when you invoke the Rename action: I tried it and both the display name and the folder on disk are changed. Delete. When you invoke the Delete action, you'll see this dialog: The checkbox is not checkable, in the default scenario, and when the dialog above is confirmed, the project is simply closed, i.e., the node hierarchy is removed from the application. However, if you truly want to let the user delete the project on disk, pass the Project to the DeleteOperationImplementation and then add the children of the Project you want to delete to the getDataFiles method: private final class CustomerProjectDeleteOperation implements DeleteOperationImplementation { private final CustomerProject project; private CustomerProjectDeleteOperation(CustomerProject project) { this.project = project; } @Override public List<FileObject> getDataFiles() { List<FileObject> files = new ArrayList<FileObject>(); FileObject[] projectChildren = project.getProjectDirectory().getChildren(); for (FileObject fileObject : projectChildren) { addFile(project.getProjectDirectory(), fileObject.getNameExt(), files); } return files; } private void addFile(FileObject projectDirectory, String fileName, List<FileObject> result) { FileObject file = projectDirectory.getFileObject(fileName); if (file != null) { result.add(file); } } @Override public List<FileObject> getMetadataFiles() { return new ArrayList<FileObject>(); } @Override public void notifyDeleting() throws IOException { } @Override public void notifyDeleted() throws IOException { } } Now the user will be able to check the checkbox, causing the method above to be called in the DeleteOperationImplementation: Hope this answers some questions or at least gets the discussion started. Before asking questions about this topic, please take the steps above and only then attempt to apply them to your own scenario. Useful implementations to look at: http://kickjava.com/src/org/netbeans/modules/j2ee/clientproject/AppClientProjectOperations.java.htm https://kenai.com/projects/nbandroid/sources/mercurial/content/project/src/org/netbeans/modules/android/project/AndroidProjectOperations.java

    Read the article

  • How to properly override Drupal imagecache presets

    - by volocuga
    Say I need to override defaul presets, provided by Ubercart module. This is what I wrote: function config_imagecache() { $presets = array( array( 'presetname' => 'product', 'actions' => array( array( 'action' => 'imagecache_crop', 'data' => array('width' => 300, 'height' => ''), 'weight' => 0, 'module' => 'imagecache', ), array( 'action' => 'canvasactions_canvas2file', 'data' => array('xpos' => 'center', 'ypos' => 'center', 'path' => 'actions/pad_300_300.gif', 'dimensions' => 'background',), 'weight' => 1, 'module' => 'imagecache_canvasactions', ), ), ), array( 'presetname' => 'uc_thumbnail', 'actions' => array( array( 'action' => 'imagecache_scale', 'data' => array('width' => 55, 'height' => 55, 'upscale' => 0), 'weight' => 0, 'module' => 'imagecache', ), array( 'action' => 'canvasactions_canvas2file', 'data' => array('xpos' => 'center','ypos' => 'center', 'path' => 'actions/pad_60_60.gif','dimensions' => 'background'), 'weight' => 1, 'module' => 'imagecache_canvasactions', ), ), ), array( 'presetname' => 'product_full', 'actions' => array( array( 'action' => 'imagecache_scale', 'data' => array('width' => 600, 'height' => 600, 'upscale' => 0), 'weight' => 0, 'module' => 'imagecache', ), ), ), array( 'presetname' => 'product_list', 'actions' => array( array( 'action' => 'imagecache_scale', 'data' => array('width' => 100, 'height' => 100, 'upscale' => 0), 'weight' => 0, 'module' => 'imagecache', ), array( 'action' => 'canvasactions_canvas2file', 'data' => array('xpos' => 'center', 'ypos' => 'center', 'path' => 'actions/pad_100_100.jpg','dimensions' => 'background',), 'weight' => 1, 'module' => 'imagecache_canvasactions', ), ), ), array( 'presetname' => 'uc_category', 'actions' => array( array( 'action' => 'imagecache_scale', 'data' => array('width' => 100, 'height' => 100, 'upscale' => 0), 'weight' => 0, 'module' => 'imagecache', ), array( 'action' => 'canvasactions_canvas2file', 'data' => array('xpos' => 'center', 'ypos' => 'center', 'path' => 'actions/pad_100_100.gif', 'dimensions' => 'background',), 'weight' => 1, 'module' => 'imagecache_canvasactions', ), ), ), array( 'presetname' => 'cart', 'actions' => array( array( 'action' => 'imagecache_scale', 'data' => array('width' => 50, 'height' => 50, 'upscale' => 0), 'weight' => 0, 'module' => 'imagecache', ), array( 'action' => 'canvasactions_canvas2file', 'data' => array('xpos' => 'center', 'ypos' => 'center', 'path' => 'actions/pad_60_60.gif', 'dimensions' => 'background',), 'weight' => 1, 'module' => 'imagecache_canvasactions', ), ), ), ); foreach ($presets as $preset) { drupal_write_record('imagecache_preset', $preset); foreach ($preset['actions'] as $action) { $action['presetid'] = $preset['presetid']; drupal_write_record('imagecache_action', $action); } } imagecache_presets(true); cache_clear_all('imagecache:presets', 'cache'); } I can see in imagecache UI the settings was applied, but really images disappeared at all. Nothing works now. Where is the mistake?

    Read the article

  • Why won't "!important" override ":first-line"?

    - by bazzlevi
    I am trying to do the tutorial in Chapter 6 of the 2nd edition of "CSS: The Missing Manual", and I've run into an issue I'm trying to understand. I have one style that looks like this: #main p:first-line { color: #999999; font-weight: bold; } Later I have another style that looks like this: #main p.byline { color: #00994D !important; font-size: 1.6em; margin: 5px 0 25px 50px; } I am confused because the second one won't override the color choice in the first one despite the fact that the second one has "!important" in it. I put both classes into an online specificity calculator, and the second one comes out being more specific, so I'm doubly confused. By the way, the inclusion of "!important" is the work-around suggested in the errata for the book. Odd that it still doesn't work! Here's the code for the entire page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>CSS Typography</title> <style type="text/css"> html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, pre, code, address, variable, form, fieldset, blockquote { padding: 0; margin: 0; font-size: 100%; font-weight: normal; } table { border-collapse: collapse; border-spacing: 0; } td, th, caption { font-weight: normal; text-align: left; } img, fieldset { border: 0; } ol { padding-left: 1.4em; list-style: decimal; } ul { padding-left: 1.4em; list-style:square; } q:before, q:after { content:''; } body { color: #002D4B; font-family: Arial, Helvetica, sans-serif; font-size: 62.5% } #main h1 { color: #F60; font-family: "Arial Black", Arial, Helvetica, sans-serif; font-size: 4em; } #main h2 { font: bold 3.5em "Hoefler Text", Garamond, Times, serif; border-bottom: 1px solid #002D4B; margin-top: 25px; } #main h3 { color: #F60; font-size: 1.9em; font-weight: bold; text-transform: uppercase; margin-top: 25px; margin-bottom: 10px; } #main p { font-size: 1.5em; line-height: 150%; margin-left: 150px; margin-right: 50px; margin-bottom: 10px; } #main p:first-line { color: #999999; font-weight: bold; } #main ul { margin: 50px 0 25px 50px; width: 150px; float: right; } #main li { color: #207EBF; font-size: 1.5em; margin-bottom: 7px; } #main p.byline { color: #00994D !important; font-size: 1.6em; margin: 5px 0 25px 50px; } #main .byline strong { color: #207EBF; text-transform: uppercase; margin-left: 5px; } </style> </head> <body> <div id="main"> <h1><strong>CSS</strong> The Missing Manual</h1> <h2>Exploring Typographic Possibilities</h2> <p class="byline">november 30 <strong>Rod Dibble</strong></p> <ul> <li>Lorem Ipsum</li> <li>Reprehenderit qui in ea</li> <li>Lorem Ipsum</li> <li>Reprehenderit qui in ea</li> <li>Lorem Ipsum</li> <li>Reprehenderit qui in ea</li> </ul> <h3>Esse quam nulla</h3> <p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p> <h3>Quis autem vel eum</h3> <p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p> </div> </body> </html> Here is the above code on JSBin: http://jsbin.com/unexe3

    Read the article

  • jQuery override default validation error message display (Css) Popup/Tooltip like

    - by Phill Pafford
    I'm trying to over ride the default error message label with a div instead of a label. I have looked at this post as well and get how to do it but my limitations with CSS are haunting me. How can I display this like some of these examples: Example #1 (Dojo) - Must type invalid input to see error display Example #2 Here is some example code that overrides the error label to a div element $(document).ready(function(){ $("#myForm").validate({ rules: { "elem.1": { required: true, digits: true }, "elem.2": { required: true } }, errorElement: "div" }); }); Now I'm at a loss on the css part but here it is: div.error { position:absolute; margin-top:-21px; margin-left:150px; border:2px solid #C0C097; background-color:#fff; color:white; padding:3px; text-align:left; z-index:1; color:#333333; font:100% arial,helvetica,clean,sans-serif; font-size:15px; font-weight:bold; } UPDATE: Okay I'm using this code now but the image and the placement on the popup is larger than the border, can this be adjusted to be dynamic is height? if (element.attr('type') == 'radio' || element.attr('type') == 'checkbox') { element = element.parent(); offset = element.offset(); error.insertBefore(element) error.addClass('message'); // add a class to the wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); error.css('top', offset.top - (element.height() / 2)); // Not working for Radio, displays towards the bottom of the element. also need to test with checkbox } else { // Error placement for single elements offset = element.offset(); error.insertBefore(element) error.addClass('message'); // add a class to the wrapper error.css('position', 'absolute'); error.css('left', offset.left + element.outerWidth()); error.css('top', offset.top - (element.height() / 2)); } the css is the same as below (your css code) Html <span> <input type="radio" class="checkbox" value="P" id="radio_P" name="radio_group_name"/> <label for="radio_P">P</label> <input type="radio" class="checkbox" value="S" id="radio_S" name="radio_group_name"/> <label for="radio_S">S</label> </span>

    Read the article

  • FOSUserBundle override mapping to remove need for username

    - by musoNic80
    I want to remove the need for a username in the FOSUserBundle. My users will login using an email address only and I've added real name fields as part of the user entity. I realised that I needed to redo the entire mapping as described here. I think I've done it correctly but when I try to submit the registration form I get the error: "Only field names mapped by Doctrine can be validated for uniqueness." The strange thing is that I haven't tried to assert a unique constraint to anything in the user entity. Here is my full user entity file: <?php // src/MyApp/UserBundle/Entity/User.php namespace MyApp\UserBundle\Entity; use FOS\UserBundle\Model\User as BaseUser; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; /** * @ORM\Entity * @ORM\Table(name="depbook_user") */ class User extends BaseUser { /** * @ORM\Id * @ORM\Column(type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your first name.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) */ protected $firstName; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your last name.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) */ protected $lastName; /** * @ORM\Column(type="string", length=255) * * @Assert\NotBlank(message="Please enter your email address.", groups={"Registration", "Profile"}) * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"}) * @Assert\Email(groups={"Registration"}) */ protected $email; /** * @ORM\Column(type="string", length=255, name="email_canonical", unique=true) */ protected $emailCanonical; /** * @ORM\Column(type="boolean") */ protected $enabled; /** * @ORM\Column(type="string") */ protected $salt; /** * @ORM\Column(type="string") */ protected $password; /** * @ORM\Column(type="datetime", nullable=true, name="last_login") */ protected $lastLogin; /** * @ORM\Column(type="boolean") */ protected $locked; /** * @ORM\Column(type="boolean") */ protected $expired; /** * @ORM\Column(type="datetime", nullable=true, name="expires_at") */ protected $expiresAt; /** * @ORM\Column(type="string", nullable=true, name="confirmation_token") */ protected $confirmationToken; /** * @ORM\Column(type="datetime", nullable=true, name="password_requested_at") */ protected $passwordRequestedAt; /** * @ORM\Column(type="array") */ protected $roles; /** * @ORM\Column(type="boolean", name="credentials_expired") */ protected $credentialsExpired; /** * @ORM\Column(type="datetime", nullable=true, name="credentials_expired_at") */ protected $credentialsExpiredAt; public function __construct() { parent::__construct(); // your own logic } /** * @return string */ public function getFirstName() { return $this->firstName; } /** * @return string */ public function getLastName() { return $this->lastName; } /** * Sets the first name. * * @param string $firstname * * @return User */ public function setFirstName($firstname) { $this->firstName = $firstname; return $this; } /** * Sets the last name. * * @param string $lastname * * @return User */ public function setLastName($lastname) { $this->lastName = $lastname; return $this; } } I've seen various suggestions about this but none of the suggestions seem to work for me. The FOSUserBundle docs are very sparse about what must be a very common request.

    Read the article

  • trying to override getView in a SimpleCursorAdapter gives NullPointerException

    - by Dimitry Hristov
    Would very much appreciate any help or hint on were to go next. I'm trying to change the content of a row in ListView programmatically. In one row there are 3 TextView and a ProgressBar. I want to animate the ProgressBar if the 'result' column of the current row is zero. After reading some tutorials and docs, I came to the conclusion that LayoutInflater has to be used and getView() - overriden. Maybe I am wrong on this. If I return row = inflater.inflate(R.layout.row, null); from the function, it gives NullPointerException. Here is the code: private final class mySimpleCursorAdapter extends SimpleCursorAdapter { private Cursor localCursor; private Context localContext; public mySimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) { super(context, layout, c, from, to); this.localCursor = c; this.localContext = context; } /** * 1. ListView asks adapter "give me a view" (getView) for each item of the list * 2. A new View is returned and displayed */ public View getView(int position, View convertView, ViewGroup parent) { View row = super.getView(position, convertView, parent); LayoutInflater inflater = (LayoutInflater)localContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); String result = localCursor.getString(2); int resInt = Integer.parseInt(result); Log.d(TAG, "row " + row); // if 'result' column form the TABLE is 0, do something useful: if(resInt == 0) { ProgressBar progress = (ProgressBar) row.findViewById(R.id.update_progress); progress.setIndeterminate(true); TextView edit1 = (TextView)row.findViewById(R.id.row_id); TextView edit2 = (TextView)row.findViewById(R.id.request); TextView edit3 = (TextView)row.findViewById(R.id.result); edit1.setText("1"); edit2.setText("2"); edit3.setText("3"); row = inflater.inflate(R.layout.row, null); } return row; } here is the Stack Trace: 03-08 03:15:29.639: ERROR/AndroidRuntime(619): java.lang.NullPointerException 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.SimpleCursorAdapter.bindView(SimpleCursorAdapter.java:149) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.CursorAdapter.getView(CursorAdapter.java:186) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at com.dhristov.test1.test1$mySimpleCursorAdapter.getView(test1.java:105) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.AbsListView.obtainView(AbsListView.java:1256) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.ListView.makeAndAddView(ListView.java:1668) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.ListView.fillDown(ListView.java:637) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.ListView.fillSpecific(ListView.java:1224) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.ListView.layoutChildren(ListView.java:1499) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.AbsListView.onLayout(AbsListView.java:1113) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.View.layout(View.java:6830) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.ViewRoot.performTraversals(ViewRoot.java:996) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.view.ViewRoot.handleMessage(ViewRoot.java:1633) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.os.Handler.dispatchMessage(Handler.java:99) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.os.Looper.loop(Looper.java:123) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at android.app.ActivityThread.main(ActivityThread.java:4363) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at java.lang.reflect.Method.invokeNative(Native Method) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at java.lang.reflect.Method.invoke(Method.java:521) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 03-08 03:15:29.639: ERROR/AndroidRuntime(619): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • drupal - override form action?

    - by n00b0101
    I originally started this question in another thread, but that thread was sorta, kinda answered, and now I primarily want to know how to specify another form action... I tried using the code below, but the form action, when output, remains unchanged, although looking at the print_r($form), it's correctly changed... Why isn't it picking up? function mytheme_user_profile_form($form) { global $user; $uid = $user->uid; //print '<pre>'; print_r($form); print '</pre>'; $category = $form['_category']['#value']; switch($category) { case 'account': $form['#action'] = '/user/'.$uid.'/edit?destination=user/'.$uid; break; case 'education': $form['#action'] = '/user/'.$uid.'/edit/education?destination=user/'.$uid; break; case 'experience': $form['#action'] = '/user/'.$uid.'/edit/experience?destination=user/'.$uid; break; case 'publications': $form['#action'] = '/user/'.$uid.'/edit/publications?destination=user/'.$uid; break; case 'conflicts': $form['#action'] = '/user/'.$uid.'/edit/conflicts?destination=user/'.$uid; break; } //print '<pre>'; print_r($form); print '</pre>'; //print $form['#action']; $output .= drupal_render($form); return $output;

    Read the article

  • How to override ant task stored in ant lib directory

    - by mchr
    At my work we use AspectJ in some of our Java projects. To get this to work with ant builds we have been placing aspectjtools.jar within ant/lib/. I am now working on a particular Java project and need to use a newer version of aspectJ. I don't want to have to get everyone who uses the project to update their local copy of aspectjtools.jar. Instead, I tried adding the newer aspectjtools.jar to the lib directory of the project and adding the following line to build.xml. <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties" classpath="./lib/aspectjtools.jar" /> However, this doesn't work as I hoped as the ANT classloader loads jars from ant/lib/ in preference to the jar I specify in the taskdef classpath. Is there any way to force ant to pick the jar checked into my project instead?

    Read the article

  • WPF Style Override breaks Validation Error event propagation

    - by Ben McMillan
    I have a custom control that overrides Window: public class Window : System.Windows.Window { static Window() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Window), new System.Windows.FrameworkPropertyMetadata(typeof(Window))); } ... } It also has a style: <Style TargetType="{x:Type Controls:Window}" BasedOn="{StaticResource {x:Type Window}}"> <Setter Property="WindowStyle" Value="None" /> <Setter Property="Padding" Value="5" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Controls:Window}"> ... Unfortunately, this breaks the propagation of the Validation.ErrorEvent for my window's contents. That is, my window can receive the event just fine, but I don't know what to do with it to mimic how a standard Window (or whoever) deals with it. If the validating controls are placed in a standard window, they work. They also work if I just take out the OverrideMetadata call (leaving them inside my custom window). Why is this happening, and how can I get the stock functionality for handling these validation error events working again? Thanks!

    Read the article

  • cannot override sys.excepthook

    - by Mert Nuhoglu
    I try to customize behavior of sys.excepthook as described by the recipe. in ipython: :import pdb, sys, traceback :def info(type, value, tb): : traceback.print_exception(type, value, tb) : pdb.pm() :sys.excepthook = info :-- >>> x[10] = 5 ------------------------------------------------- Traceback (most recent call last): File "<ipython console>", line 1, in <module> NameError: name 'x' is not defined >>> pdb.pm() is not being called. It seems that sys.excepthook = info doesn't work in my python 2.5 installation. What should I look into? Any suggestion? Thank you

    Read the article

  • Override HTML Anchor Link Target inside iFrame

    - by wag2639
    We're calling an ad from an ad network to dynamically load an add using JavaScript. It makes an iFrame with the actual ad in it, a picture wrapped in an anchor tag with the target=_top. Is there a way from our page to change its target and capture the attempt to change our page. Also, our page is loaded in a C#.net program using a WebControl (I forget the actual control being used since it was a while ago). We can change the C# code but we really prefer not to because then we'd have to test it and everything. Is there a way to do this with JavaScript or JQuery?

    Read the article

  • Asp.net Webdeployment Project override applicationSettings

    - by citronas
    I got a web deyploment project for a web application project in vs 2008. While building the web deployment project, I want to replace properties in the web.config. My settings are autogenrated by the deisgner. <applicationSettings> <NAMESPACE.Properties.Settings> <setting name="Testenvironment" serializeAs="String"> <value>True</value> </setting> </NAMESPACE.Properties.Settings> </applicationSettings> In the config file which contains the settings for the specific server looks like the following: <?xml version="1.0"?> <applicationSettings> <NAMESPACE.Properties.Settings> <setting name="Testenvironment" serializeAs="String"> <value>False</value> </setting> </NAMESPACE.Properties.Settings> </applicationSettings> Sadly, this does not work. I get an error "The format of a configSource file must be an element containing the name of the section" that highlights the second line (2nd example code). How must the Tag be named in order to make evertything work? Edit: Deleting the "applicationSetting"-Tags does not work either.

    Read the article

  • WPF - TextBlock - Cannot override OnRender

    - by Nitin Chaudhari
    Hi, I am creating a custom control by deriving TextBlock, my intention is to do some custom rendering based on some dependency properties. However the OnRender method is sealed on TextBlock. Although I can get my work done by overriding OnRenderSizeChanged, this is not correct. Any ideas on how can i do it the right way? Thanks in advance.

    Read the article

  • MSBuild Override Project Reference to resolve to Precompiled Assembly

    - by Ryu
    Situation I have about 400 csproj files using project references. About 3 of those a separate team wants to fork and incorporate into a standalone app. I branched the 3 projects of interest, and because the separate team uses a diff SVN repo I used svn externals to pull in these projects into the folder of the standalone app. Obviously since this team uses a different folder structure the project references no longer resolve. Attempted Solution I figured setting the msbuild properties ReferencePath and AdditionalLibPaths to point to a directory with all the precompiled dependencies would allow the project references a fallback point and resolve correctly. However that doesn't appear to be the case. Question Does anybody know a way to have a failed projectreference look up resolve to the precompiled dll? Perhaps point me to an automated tool to convert projectreferences to dll references? Or is there a better way to solve this problem? Thanks

    Read the article

  • Override colorscheme

    - by RymdPung
    I often find myself wanting to change just something little in a colorscheme, but i don't want to edit the original file. I tried putting my change in '~/.vim/after/colors/blah.vim', but that doesn't work for me. Example, I want to change the CursorLine highlight in BusyBee.vim.. ~/.vim/colors/BusyBee.vim I create the file '~/.vim/after/colors/BusyBee.vim' and add this: hi CursorLine guibg=#000000 ctermbg=Black cterm=none However, i don't see the change. Of course it works if i change the line in the originial BusyBee.vim, but like i said i'd prefer not to do that. Doing... :colo Busy<TAB> Shows me... BusyBee BusyBee

    Read the article

  • Override default behavior of SPACE key in .net WinForms ListView

    - by Axarydax
    Hello, I'd like to implement some custom behavior of Space key in a ListView. Basically I'd like to toggle selected status of the item under cursor - that should be fairly simple this.FocusedItem.Selected = !this.FocusedItem.Selected; but alas, it also does the default action, which is to select the focused item. This way I am unable to 'unselect' the focused item. I've looked for similar problems and they suggest using PreviewKeyDown event, in which I would process the key and disallow the ListView to do its default action. But the PreviewKeyDown event argument has no "handled" property, so I cannot 'eat' this key.

    Read the article

  • Override tooltip text for Titlebar buttons (Close, Maximize, Minimize, Help)

    - by Tim
    I have been trying without luck to change the text of the tooltip that appears for the buttons on the main title bar of a form. In a nutshell, we have harnessed the 'Help' button for Windows Forms to have some other purpose. This is working fine. The issue is that when hovering the mouse over that button, a 'Help' tooltip appears, which doesn't make any sense for the application. Ideally, there would be some way to change the text of that tooltip for my application; however, at this point I would be satisfied just finding a way to disable the tooltips altogether. I know that you can disable the tooltips for the entire OS by modifying the 'UserPreferencesMask' key in regedit, but I would really like a way to have this only affect my application. Again, ideally there would be some way to do this with managed code, but I would not be opposed to linking into the Windows API or the like. Thanks for any suggestions for resolving this issue!

    Read the article

  • Any way to override how <choice> element is binded by xsd.exe

    - by code4life
    I have the following elements in my schema: <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="optimizeModelBase"> <xs:attribute name="name" type="xs:string"/> </xs:complexType> <xs:complexType name="riskModel"> <xs:complexContent> <xs:extension base="optimizeModelBase"> <xs:attribute name="type" type="xs:string" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="fullCovariance"> <xs:complexContent> <xs:extension base="optimizeModelBase"> <xs:attribute name="fromDate" type="xs:date" use="required"/> <xs:attribute name="toDate" type="xs:date" use="required"/> <xs:attribute name="windowSize" type="xs:int" use="required"/> </xs:extension> </xs:complexContent> </xs:complexType> In my main schema body, I use a element to specify a 1-of situation: <xs:choice id="RiskModelParameter"> <xs:element name="RiskModel" type="riskModel"/> <xs:element name="FullCovariance" type="fullCovariance"/> </xs:choice> When I run xsd.exe, the resulting code is: [System.Xml.Serialization.XmlElementAttribute("FullCovariance", typeof(fullCovariance))] [System.Xml.Serialization.XmlElementAttribute("RiskModel", typeof(riskModel))] public optimizeModelBase Item { get { return this.itemField; } set { this.itemField = value; } } The issue is that the element's ID tag is being ignored, and xsd.exe is arbitrarily naming the property "Item". I have to admit, it's not a big issue, but it's starting to annoy me. What makes this extra annoying is that if I have additional elements at the same level, xsd.exe binds them as "Item1", "Item2", etc. Does anyone know if it's possible to not have xsd.exe name my choice elements as "Item", and instead be able to put in my own property names?

    Read the article

  • Flex DownloadProgressBar preloader override

    - by Shawn Simon
    I'm watching this video, which is pretty good http://www.gotoandlearn.com/play?id=108 It shows how to inherit from DownloadProgressBar to create a customer preloader for your flex app. The DownloadProgressBar class has an overridable getter for the property 'preloader.' Isn't this poor design? What does a property called preloader have anything to do with a class for a DownloadProgressBar?

    Read the article

  • Override number of parameters of pure virtual functions

    - by Jir
    I have implemented the following interface: template <typename T> class Variable { public: Variable (T v) : m_value (v) {} virtual void Callback () = 0; private: T m_value; }; A proper derived class would be defined like this: class Derived : public Variable<int> { public: Derived (int v) : Variable<int> (v) {} void Callback () {} }; However, I would like to derive classes where Callback accepts different parameters (eg: void Callback (int a, int b)). Is there a way to do it?

    Read the article

  • Extjs Form Action Submit - Custom override?

    - by Scott
    Looking at the source code of Action.Submit, I'm trying to figure out where ext is appending the form's fields to the parameters. Instead of sending each field as a separate parameter, I want to send something like: formObj:{field1:value, field2:value} Currently, each of those values are simply added to the parameter list along with any custom/baseParams. Where are these formfields being added so that I can change this behaviour? Thanks.

    Read the article

  • Override mime type with VS Web Dev Server

    - by Douglas
    I would like to serve xbaps from the VS web dev server (cassini) to Firefox, but when served from the dev server, Firefox offers to download this file. As far as I can tell, this is because the dev server is serving the xbap file with a mime type of "application/octet-stream" instead of "application/x-ms-xbap", which works when served from IIS. Does anyone know how to change the mime type which the dev server uses for *.xbap files?

    Read the article

  • Force VSProps settings to override project settings

    - by Steve
    I have a vsprops file that defines the optimizations all of our projects should be built with for Visual Studio 2008. If I set the properties for the project to "inherit from parent of project defaults" it works, and fills them in the vcproj file. However, this doesn't protect me from a developer checking in a project file that changes the optimizations. In this case, the project settings are used over the vsprops settings. I need to make it so that vsprops always takes precedence over what is in the vcproj file. Is this possible? Other workarounds are also welcome.

    Read the article

  • Python: override __init__ args in __new__

    - by EoghanM
    I have a __new__ method as follows: class MyClass(object): def __new__(cls, *args): new_args = [] args.sort() prev = args.pop(0) while args: next = args.pop(0) if prev.compare(next): prev = prev.combine(next) else: new_args.append(prev) prev = next if some_check(prev): return SomeOtherClass() new_args.append(prev) return super(MyClass, cls).__new__(cls, new_args) def __init__(self, *args): ... However, this fails with a deprecation warning: DeprecationWarning: object.__new__() takes no parameters SomeOtherClass can optionally get created as the args are processed, that's why they are being processed in __new__ and not in __init__ What is the best way to pass new_args to __init__? Otherwise, I'll have to duplicate the processing of args in __init__ (without some_check)

    Read the article

  • How to override the default init.tcl

    - by Sean Murphy
    I'm working on a project where I want to make use of TCL as the command interpreter. I have a working c library object which I can load from within the tcl shell but my problem is finding a way to automatically do this while starting a tclsh. Essentially my ultimate goal is to be able to run a script and have it load my library and run some initial startup tcl code before dropping me back to the tclsh command prompt in interactive mode. e.g. tclsh -f myscript.tcl --then-switch-to-interactive or EXPORT TCLINIT=myscript.tcl tclsh The basic goal is to avoid having to distribute tclsh but rather rely in local user installations of tcl. All I would like to distribute is my library, a startup script and a shell command to launch the tclsh with the library preloaded. I've tried using the environment variables TCLINIT and TCL_LIBRARY but they seem to have no effect. The only workable solutions I've found so far are to add "source myscript.tcl" to either the end of /usr/share/tcltk/tcl8.5.init.tcl or ~/.tclshrc However both of these "solutions" are non perfect as they require modification of the default users workspace. It strikes me that there must be a way to handle this in TCL, but my research so far hasn't yielded anything. Does anyone have any suggestions?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >