Adding a third tab in Android studio xml editor - intellij-idea

I want to write an Android Studio IDE plugin which will add a third tab (After "Design" and "Text" tab) in the XML file editor view.
What I am trying to accomplish is to have a different representation of the layout XML files.
I tried going through the files present under this page but I could not find anything useful.
Can anyone help me please ?
EDIT:
This screenshot shows what I am trying to do.
This third tab will show the layout in JSON format , the JSON being constructed by my plugin.
The main purpose of this tab being this : Once the user approves the JSON structure, the plugin will upload the JSON to my server to store my layout on the cloud.
I have gone through IntelliJ plugin creation process. But since I am building a plugin on top of Android's plugin, I am not able to find any good starting point.
If someone can point me to the source code for the XML layout editor view, I can work from there.

This solution works for me :) and I guess this is simple... you can now make you external tool and distribute for install. In my case when the ViewText windows is deactivated or loses focus, I just close the window automatically...

Related

Save Current View in intelliJ IDEA

I have several files open in a split view in the intelliJ IDEA. Is there a way to save this setup (ie: which files are open and witch side of the split view they are on)?
I am hoping to work on some other aspects of the program for now, but will need to return to this view/setup periodically.
I have looked under Window | Editor Tabs but could not find anything there.
As pointed out by CrazyCoder in the comments, this feature does not yet exist in intelliJ. There is a related feature request here:
https://youtrack.jetbrains.com/issue/IDEA-12130

Open Text in App

I am looking for a way to right click selected text and open it in my app. Eg. via OS X's third party share menu. But I can not find any references at Apple's.
Have a look at the apple docs SysServices for creating a service for you app.
The Docs take you through an example of how to set one up.
Once done you will need to go into System Preferences and Enable the service. Your users will also need to do that.
Here is a quick project that shows an adaption of the apple code.
Update:
Although I think the services work good enough. Creating a Share or Action Extension is possible.
This example uses the same Project as above. But I have added an App Action extension (Target) to it.
The template for the Action is not too hard to understand and it took me 5 minutes to do this quick example.
(So I am not saying everything is as it should be but it works)
For the Action Extension:
Follow the instructions here
Which basically is:
After you choose the extension point that makes sense for your app
extension, add a new target to your containing app. The easiest way to
add an app extension target is to use an Xcode template that provides
a target preconfigured for your extension point.
To add a new target to your Xcode app project, choose File > New >
Target. In the sidebar on the left side of the new target dialog,
choose Application Extension for iOS or OS X. In the pane on the right
side of the dialog, Xcode displays the templates you can choose
Do read the above docs to understand better of what you need to do.
Once you have added the Extension. You can actually run it straight away.
Xcode provides you an option to choose a test app to test it in i.e TextEdit.app and takes you through the whole process of temporarily enabling the Extension.
In this example, remember I chose an Action Extension which suited the App.
The App's function in life is to do a basic encryption of selected text and then display the result.
The App's Action Extension will do the same but instead of displaying it, it will replace the selected text with the encryption text.
All that was needed for me to do, was copy the encryption method from the main app, over to the Extension.
I did have to adjust a couple of things though. Namely the original code deals with a NSString, where as the Extension deals with a NSAttributedString.
The conversion I did works but styling attributes are lost. For this example that does not really matter.
An Action Extension does not use the Share contextual menu. It uses an Action menu.
To see the menu, select some text and the hover the cursor over the selected text. You then should see a discloser button on the left of the text.
Like this:
Click it and choose the Extension.
If you do not see it, go to the 'more' option. This will take you to the system preferences where you can grant access to the extension.
The documentation is mainly concerned about distributing the extension and App via the App store.
But you can code sign your App and extension and do a normal archive export.
From there, all should work ok with gatekeeper.
But again refer to the Docs for a fuller understanding.
Here is a link for the code signed app and also the new Project.
Encrypto2

Displaying filtered issues in JIRA project tab

This is my first attempt to create a JIRA plugin and I'm completely lost.
I have already managed to create a project tab plugin. However, I can't find the way to populate the screen with any more than HTML.
My main goal is to display a list of filtered issues in the project tab. I saw the issues list displayed in the Versions tab (screenshot: http://cl.ly/image/0g1O3v0M0p38/Screen%20Shot%202015-03-25%20at%203.49.35%20PM.png) and I figured I could copy the code that did that on a project tab. However I can't find the code that does this.
Any pointers you can give me would be highly appreciated.
TL;DR: Need to know how to filter issues and display them in a project tab.
1) how to filter issues
Please look here: https://confluence.atlassian.com/display/JIRA/__Searching+in+JIRA
2) display them in a project tab.
Here is the answer: JIRA Plugins - How to add webwork action to a project panel?

MobileFirst V6.3 folder common/js/services in design perspective

I want create a folder named “services” below “common/js”. Unfortunately, Eclipse seems to get confused with this name while in MFP Design perspective. It doesn’t display the content of the folder, but instead the same services I can see in the services folder in the project root.
As soon as I rename my folder to something else, everything is fine again.
This is no big issue, but can be interesting understand if a sort of filter is applied in Design perspective.
If you will open the Navigator view, in either Java EE or Design perspectives you will see the files that you place in the common\js\services folder. You will also see the files' properties in the Design perspective's Properties view.
You will not see them if you are in the Project Explorer view, in either Java EE or Design perspectives.
It's an odd one. We'll take a look.
This is a curious little default setting in Eclipse, to make your services folder visible:
In the project explorer, select the little down arrow in the top right, in the resulting Menu select Customise View.
Select the Content tab and uncheck the Services Navigator Content option.

Intellij Idea does not recognize ivy.xsd

Why my IDE does not recognize xsd by URI ?
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
You will need to download the schema first. IntelliJ allows to do that using intentions. Set cursor on the red marked fragment, press Alt+Enter and select 'Fetch External Resource'. Schema should be downloaded and you will start getting element suggestions in the file.
Sometimes automatic resource fetching may not work and the location will remain red marked. In such case you will need to download the schema to some location to disk and select 'Manually Setup External Resource' from intentions menu. Point to the downloaded file and you should get it working.