How to import .XML code style into IntelliJ Idea 15 - intellij-idea

I want to use a specific code style in my editor defined in an XML file, which looks something like this:
<code_scheme name="CustomStyleName">
<option name="JAVA_INDENT_OPTIONS">
<value>
...
How is it possible to import this style into IntelliJ Idea.
When I go to Preferences->Editor->Code Style->Manage it is only possible to import an Eclipse XML Profile.

If your XML is previously exported Intellij you can simply do:
File > Import Settings > select your xml
If its custom defined, one you can try copying your xml to intellij config directory:
config/codestyles
Assuming your xml is in format intellij can understand, it will then show up in
Code Styles > Manage
If your XML is in different format, try to match tags with one of pre-defined styles(also XML)

For users coming here for the same issue but recent IntelliJ version (like 20), it is a bit different now.
Once you've exported your formatter in XML, then follow these steps:
Go to Preferences
Select Editor
Sele Code Style
Select the language of your choice (eg Java)
Go to Scheme at the top, click on the setting button by the side
Select the option to import scheme, choose your formatter type and select the xml file. Then save and apply.
If you see error "IntelliJ IDEA code style XML import failed with error message: null", check to ensure your XML file has the file definition <?xml version="1.0" encoding="UTF-8"?> at the top.
NOTE: This is for MacBook. I believe the difference won't be much in other platforms.

Related

How to declare module_name in groups Odoo

I used this code in a xml view in ideas_app module:
groups="group_vote_user"
but i got this error "External ID must be fully qualified"
Is it really need module name like groups="ideas_app.group_vote_user" even this view in same module with group_vote_user security (in module ideas_app)?
Is there any ways to not declare module name or change with this.group_vote_user like that?
I think, you need to check sequence of files in manifest file. For example, security.xml should be come first and then others view files.
I am not sure if there is a way to change it. But as per standards, we need to follow standard way like "module_name.xml_ID"

IntelliJ Live Template groovy script cut'n paste from clipboard

I know this can be done because I've done it before but can't remember how.
You create a live template in IntelliJ and you set a variable called $GROOVY$ which takes the output of this expression:
groovyScript([Some file path])
Then you write a Groovy script at the file path in question. The idea is that I'm going to copy some Ivy style dependencies and then paste them as maven style dependencies such that colon separated Ivy specs become XML maven when I paste them.
Specifically what I cannot remember is how to get the live template to pull content from the clipboard.
I'm not sure that I completely follow what you are trying to do but I think the crux of it is this:
how to get the live template to pull content from the clipboard.
You can do this by defining a parameter named, for example, $clipboard$ and then associating this variable with the Live Template method: clipboard().
For example, given the following live template:
// Here are the contents of the $clipboard$
With this value in the system clipboard:
foobarbas
Then engaging the live template will result in the following ouput:
// Here are the contents of the foobarbas
Here are some screenshots showing it in action:
Define the live template:
Use the template:
Here's the result:
groovyScript("return _1.replace(\"-\", \".\")", clipboard())
Pull data from example-clipboard-body to example.clipboard.body.

Customize genmodel not to create plugin.xml, plugin.propeties and build.properties

I have a metamodel.ecore which I generate its Model Code from the genmodel file (Right click on metamodel.genmodel ==> Select Generate Model Code);
However, some additional files (plugin.xml, plugin.properties and build.properties) are created during code generation. Since I just need the model code for my special purpose (e.g. I don't want my current project to be converted to a plugin project), I want to prevent generating these files.
Any simple way to do that?
With the properties view opened, select the root element in your genmodel. You need to do the following changes in your genmodel:
Set All / Bundle Manifest to false. It will prevent MANIFEST.MF to be generated.
Set Model / Model Plug-in ID to empty string or use the button on the top right of the properties view named "Restore Default Value" to set it to null. It will prevent the generation of the files plugin.xml, plugin.properties and build.properties.
Set Template & Merge / Update Classpath to false. This one is optional but with your use case, you may want EMF to stop messing out with your .classpath file.

Oracle SQL Developer query result Export Wizard default output file name

In Oracle SQL Developer when you right click into a query result and select export it brings up the Export Wizard.
After selecting the format you want (in this case .xls) the default save as target is (for me)C:\Documents and Settings\XXXXX\export.xls
What i would like is to change the default output file name from always being export to something that is dynamic, a timestamp perhaps?
I would even be happy to implement a 3rd part extension to handle this.
As discovered this is not currently possible but is currently down as a feature request with Oracle to be implemented if it gets enough attention from users.
Feature request:
https://apex.oracle.com/pls/apex/f?p=43135:7:114031166834052::NO:RP,7:P7_ID:41561
I know this is an old thread but I was looking for an answer to this, and wanted to share some information for anyone else who comes along.
As far as I know you still can't set the exact text of the file name or add a timestamp to it, but if you change the "Save As" setting in the Export Wizard window (this can be made permanent through the Tools - Preferences menu) to "Separate Files" then each export will be given a different file name in the specified folder automatically. This works even if the export is the same query. SQL Dev names each file "TABLE_EXPORT_DATA.xls" and will amend a number at the end after each export. So for example:
TABLE_EXPORT_DATA_4.xls
TABLE_EXPORT_DATA_3.xls
TABLE_EXPORT_DATA_2.xls
TABLE_EXPORT_DATA_1.xls
As #markleiber said, it isn't possible to change the default file name, but if you go to Tools/Preferences/Database/Utilities/Export/<Export Type>, you can change the default folder for this type of export.
You can also change default worksheet names and choose to include or remove headers for Excel format exports.

IntelliSense in VB Xml literals

is there a way to enable IntelliSense for XML literals in VB9 (VS 2008)?
The ideal source of IntelliSense is an XSD document, but I can use anything else format to do it.
Thanks
http://msdn.microsoft.com/en-us/library/bb531402.aspx
It works, I used it a few months back. If you have VS2k8 Docmentation installed, go to How to: Enable XML IntelliSense in Visual Basic at ms-help://MS.MSDNQTR.v90.en/dv_vbalr/html/af67d0ee-a4a6-4abf-9c07-5a8cfe80d111.htm, it has the example you need to get this working. The on-line documentation is lacking.
How to Use LINQ to XML
How to: Enable XML IntelliSense in Visual Basic
Shows how to add an XML schema to a Visual Basic project to provide XML IntelliSense that shows possible attributes, child elements, or descendant elements for XML literals.
Excerpt
To import an XML namespace in a code file
Identify the target namespace from your XSD schema.
At the beginning of the code file, add an Imports statement for the target XML namespace, as shown in the following example.
Imports <xmlns:ns="http://someNamespace">
To import an XML namespace as the default namespace, that is, the namespace that is applied to XML elements and attributes that do not have a namespace prefix, add an Imports statement for the target default XML namespace. Do not specify a namespace prefix. Following is an example of an Imports statement.
Dim phone2 As XElement = <phone type="home">206-555-0144</phone>
phone2.#owner = "Harris, Phyllis"
Console.WriteLine(phone2)
'Imports <xmlns="http://defaultNamespace">
I haven't seen any way of doing this. Please go rate or comment on this suggestion on the Microsoft Connect site.
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=490740