GXT 3.x Custom PropertyEditor / ValueBaseInputCell - editor

I'm trying to write a custom field editor that will translate between Long and String. IE: String representation on screen but field type is a Long.
I've implemented the PropertyEditor (HrMinPropertyEditor) but don't know how to wire it in. My HrMinField is quite clunky as I needed to use a TriggerFieldCell because the generic types inside TextInputCell etc. prevented me from using them.
Do I need to do a subclass of ValueBaseInputCell? That seems strange since my PropertyEditor has all the Long / String conversions. It also looks difficult.
If so, is there a simple example or some documentation I can read?
BTW, my learning project is Maven based and should be easy to fire up if necessary:
svn checkout http://subversion.assembla.com/svn/freshcode_public/learn/gwt/ learn-gwt
cd learn-gwt
mvn gwt:run
Navigate to GXT | Forms | Time Edit
Thanks in advance,
Pete
PS: I've asked this on the Sencha forum too.

You should use method setPropertyEditor from Field class to specify your custom property editor:
HrMinField f = new HrMinField();
f.setPropertyEditor( new HrMinPropertyEditor() );

I managed to come up with a solution using a Converter and a Validator.
The more complete answer is on the Sencha thread.

Related

ZF2 BBCode Parser

Hiho,
I use the ckeditor on my website for special textareas like forum
or signatures.
But I have a problem with the output. I use ZF2 and would like to
use ZendMarkup to render the output bbcode back in html.
But at every time I call
$bbcode->render(...)
I got the error
There is no Zend_Markup_Root markup.
The ZendMarkup is an extension inspired by the Zend_Markup from ZF1.
But I can't find any thing on API or other guides.
Does someone has any idea what as the problem is?
The ZendMarkup library is very old (last update is 10 months ago!) so I wouldn't use such library. If you would like, I think I traced the error down.
On this line there is a reference to Zend_Markup_Root while that should be ZendMarkup\Renderer\Markup\Html\Root. Try to change that line and see what happens.
Another way is to replace the ZendMarkup library with another library which does work and is updated regularly. An example is Decoda. If you load mjohnson/decoda in your composer.json, you can use Decoda in your Zend Framework 2 application:
<?php
use Decoda\Decoda;
$parser = new Decoda($bbcode);
$html = $parser->parse();
With tools like composer, there is no need to use solely Zend* components when there are better alternatives.

Neo4J and timestamps

I need information about node's creation & last modification dates...
Is there a way to automatically handle created and updated properties for a node?
Hibernate offers #Version for updated field. Is there something similar with Node4J.
I found http://neo4j.rubyforge.org/classes/Neo4j/Rails/Timestamps.html but it seems to be only available for Ruby.
You can use annotations form the spring-data-commons library. Use #CreatedDate and #LastModifiedDate on properties of type Long. Make sure you're using the simple mapping mode. For now, advanced mapping mode does not support this, see DATAGRAPH-335.

How I can add some items to the code completion combobox of the Delphi IDE

I'm working in a Delphi IDE expert and I wonder if it's possible add new items to the code completion combobox displayed by the Delphi IDE when the user press CtrlSpace
UPDATE:
What I need is add items to the code completion list based in a specified type.
example suppose which I have a type called TMytype, what I want to do is add addional items to the code completion list when the user type a variable of the type TMytype
check this image
I found your question somewhat confusing but if you are in search of credible source on "Custom Live Templates" and the like on Delphi, head to the blog of Cary Jensen here.
Edit:
Looking forward to further improvement of the scope of the question, I suggest here another direction to explore:
Source code manipulation using IOTAEditor, IOTASourceEditor, IOTAEditReader and the like
Some Parsing for sanity check prior to apply any modification.
Adoption of Client DataSet as a format to store data (It's serializable) to simplify the coding of IDE editors.
Perhaps I haven't fully grasped the extent of what you are asking here, but you can add templates simply by going to 'View|Templates' from the Delphi IDE. This then opens a template viewer. Press the '+' icon. It opens a template1.xml document which you can then edit so create your new item.
If you wish to do this programatically, just add an xml file (of the same format) to the ..\RAD Studio\code_templates folder.

Autocomplete with Vim and Rails Datamapper

Is there a way that I can have auto completion in Vim after I load a model from the database?
So for example if I have a model of type Foo with an instance method of type bar and do the following
foo = Foo.first(:param=>'x')
foo.b
should show me bar as a possible auto complete value. I think that this is somewhat hard to accomplish with dynamic languages and you would probably have to be aware of the datamapper conventions.
Maybe I'm taking the wrong approach and should not be thinking using auto complete because there is an easier way to code?
I don't think it's possible to do semantic completion in VIM. However if you have written the instance name once, you could use the simple auto completion in VIM to avoid typing long names again.

Problems with Netbeans re: Rails erb/rhtml intellisense?

I've been using Netbeans for Rails and like it a lot, considering how little I paid for it. But something that bothers me is that when I'm editing an RHTML or ERB file, it doesn't do the code autocomplete - or at least not reliably. Sometimes it shows the appropriate variables and methods that are available on an object after you type the dot operator. Sometimes it ignores the instance variables. Is there a solution for this? (Please don't say RadRails).
Oh and one more thing in case anyone has solved this: considering how often I have to type <% when I'm in a Rails template, I wish there was some hotkey for autotyping the tag . . . ? I always have to stop and look down at my keyboard to find the < and % keys before I can type the tag so it's not as trivial as it might sound.
I believe you're looking for something like this:
http://ruby.netbeans.org/codetemplates-rhtml.html
Type in one of the triggers, then hit the tab key to expand it to the code as given.
Also, you might want to explore using HAML. It's much easier on the hands.

Resources