Struts2 registers a local converter and a local Converter
To implement a custom converter, You need to inherit the defatypetypeconverter class or the StrutsTypeConverter class from the objects to be converted, and obtain the entry of a type converter to implement the developer's own type
1. Emf.edit
A) Description: Emf.edit is located between Emf.editor and Emf.ecore, he played an intermediary role. He is responsible for translating UI-related requests from Emf.editor into Emf.ecore UI-independent calls. He needs to provide the following four features: implementing ContentProvider and Labelprovider to support the viewer display, and implementing the Ipropertysource for supporting the display of properties Implement the commandframework used to support the operation of the model
Generating EMF in. NET mainly uses metafile objects, but in the process of using the image will automatically enlarge the problem of extra white space.Simulation: Declares the area of size (100,100) and draws a line of P1 ( -50,-50)->p2 (50,50).General conditions such as:The (0,0) point in the figure is not the upper-left corner.To correctly qualify a zone method:New Metafile (file, IntPtr, Visibleclipbounds,metafileframeunit.pixel);Results such as:[.
Step 1: Import EMF plug-ins to the relevant directories (plugins, features)
Step 2: Create an EMF project.
Step 3: enter the name of the generated project
Step 4: Import XSD and modify the corresponding name:
Step 5: Click Finish to configure ecore-related attributes and click Save.
Step 6: Configure genmodel attributesSelect its root directory:
We need to configure the
Export all images in word at a time, which can be JPG, BMP, PNG, GIF, EMF, or TIF
1. Word documents contain a large number of images,
FormatThere may be different images of OLE objects, such as Visio. This tool solves this problem by exporting all the images in the specified format.
2. Export all images in one word at a time in the format of JPG, BMP, PNG, GIF, EMF, Tif, and image size.
WordThe same siz
1, the simple scene is to copy a eobject, you can use the tool class method Ecoreutil.copy ().2. Scenario: Your to class inherits the class created by EMF and needs to replicate all the attributes in the parent class. /*** Copy all properties of the parent class into the subclass. Class definition child must be extends father;@paramFather *@param Child*/ Public Static voidFathertochild (eobject father, Eobject child) { for(Field field:father.ge
Typeconverter class. The description in msdn provides a unified method to convert the value type to other types, as well as access standard values and sub-attributes.Let's take a look at the example to translate a string into a type converter with a point structure.Public class pointconverter: typeconverter {Public override bool canconvertfrom (itypedescriptorcontext context, type sourcetype ){If (sourcetype = typeof (string) {return true ;}Return bas
TCP transmission: Use the socket service to implement a text converter, socket Text Converter
Reprinted please indicate the source, thank you: http://blog.csdn.net/harryweasley/article/details/45665291
I recently read a teaching video and learned socket programming. There is an example in which I feel that it is well written. I will organize it here to help me recall and view it.
Requirement: Text
Overwrite the getpropertysheetpage () method of xxxeditor. Java generated by EMF. For the remaining steps, see the followingCodeThis example uses a custom dialog box for a specific type of eattribute (etype is "com. Your. etype") to set the attribute value.
/** * This accesses a cached version of the property sheet. * */ Public Ipropertysheetpage getpropertysheetpage (){ If (Propertysheetpage = Null ) {Propertysheetpage = New Extendedproperty
pageMv.addobject ("datamsg", Ex.getmessage ()); returnMV; } @RequestMapping ("/first") //The type conversion work must be performed before the actual handler method executes. PublicString Dofirst (Date birthday,intAgethrowsException {System.out.println ("222222222222222222222"); System.out.println (Birthday+ "==========="); System.out.println ( Age+ "==============="); return"/index.jsp"; }}4. MapperXmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"Xmlns:context= "Http://www.springfr
; requestmappinghandlermappingAnnotationmethodhandleradapter-> RequestmappinghandleradapterAnnotationmethodhandlerexceptionresolver-> ExceptionhandlerexceptionresolverAll of the above are automatically registered after using the Annotation-driven.and the corresponding respectively provided abstracthandlermethodmapping, Abstracthandlermethodadapter and Abstracthandlermethodexceptionresolver to make it easier for users to implement custom implementation classes.
Spring MVC
Java code
As can
object to a string in some way.
To achieve these transformations, there is a magician in Struts 2.0 who can help you--converter. With it, you don't have to repeat this code over and over again:
Date birthday = dateformat.getinstance (dateformat.short). Parse (strdate);
OK, now let's take a look at an example.
Converters--hello World
At the end of my last article, "Internationalizing in Struts 2.0 (i18n) Your application," I gave an example tha
can be installed on a physical or virtual machine Converter Standalone. the Converter Standalone server,Converter Standalone agent, and Converter Standalone client can be installed locally . If you install Converter Standalone in local mode , you can create and manage conver
A type converter is an important part in the process of customizing server control attributes. This article introduces the basic concepts and implementation methods of the type converter.1. Basic concepts of type converterA type converter is an auxiliary function implementation of custom server controls. It is mainly used to perform bidirectional conversion from
Blank field in actionform
The blank field of actionform indicates that when this input field is not in the form, the El expression is used to take the value and the JSP script is used to take the value. The other is that the form contains this input field, but there is no value. The El expression is used to take the value and the JSP script is used to take the value. The result is as follows:
There is no input field in the form. The value received by the JSP script is null, the string is nul
A type converter is a more important element in implementing a custom server control property. In this paper, the basic concepts and implementation methods of type converters are introduced.1. type converter Basic ConceptsA type converter is an accessible feature implementation of a custom server control. It is primarily used to perform bidirectional conversions
Currently, there are too many file formats. As far as I am concerned, from 96 years of contact, I can't say that I am very proficient, and I can say that, but it is also a headache to see a wide variety of file formats. Sometimes you may find that a good file cannot be opened! File converters in the web era can help us solve this problem!
File Converter is a very useful online tool that can convert some unfamiliar file formats into familiar or favorit
A type converter is a more important element in implementing a custom server control property. In this paper, the basic concepts and implementation methods of type converters are introduced.
1. type converter Basic Concepts
A type converter is an accessible feature implementation of a custom server control. It is primarily used to perform bidirectional conversi
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.