What is Advanced module tab in Eclipse checkstyle plugin used for? - eclipse-plugin

I am studying about checkstyle and eclipsecs plugin. When I create new "check" (by open new module), i noticed that they have Advanced tab with some strange features inside: id, comments, tokens (except custom check messages - it is obvious). You can see in my screenshot.
I did read their documents but haven't seen any explanation about these options.
Could you please explain it for me? Thank you very much.

These are possible properties in the checkstyle.xml which the Eclipse-CS visual editor is creating.
A check may be assigned an ID, which can later be used to refer to it, e.g. when suppressing it under certain circumstances. This is useful if you use the same type of check multiple times with different properties. This answer gives an example which makes use of this feature.
The comment is Eclipse-CS specific metadata. It is really just a comment text which is saved as check metadata (metadata element). But it is interpreted by the Eclipse checkstyle plugin only, which shows it again on the advanced tab.
The translate tokens checkbox adds a natural language (and possibly even localized) description to the list of tokens, if such list is present in the selected check. In your example, it is not, so the checkbox has no effect on this check (but it does on others, as that one is a global checkbox!).
Following are some screenshots with an example of the WhitespaceAround check, which supports lots of tokens.
Tokens list "raw" (no translation or sorting):
Tokens list "translated":
Tokens list "translated" and "sorted":
The sorting also affects the order in which tokens are written to the generated configuration file. The sorting seems to have to do with the numerical values of these tokens. Since they are internal and not visible to us users, it seems to have little use. Example:
Not "sorted":
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,
BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,DO_WHILE,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,
LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,
LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,
MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,
SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,WILDCARD_TYPE,GENERIC_START,GENERIC_END"/>
</module>
"Sorted":
<module name="WhitespaceAround">
<property name="tokens" value="COLON,NOT_EQUAL,QUESTION,DIV,DIV_ASSIGN,BXOR,BXOR_ASSIGN,
MINUS,LCURLY,RCURLY,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND,BAND,LAND,BAND_ASSIGN,MOD,
MOD_ASSIGN,PLUS,PLUS_ASSIGN,LT,GENERIC_START,SL,SL_ASSIGN,LE,ASSIGN,MINUS_ASSIGN,
EQUAL,GENERIC_END,GT,GE,SR,SR_ASSIGN,BSR,BSR_ASSIGN,BOR,BOR_ASSIGN,LOR,LITERAL_ASSERT,
LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,DO_WHILE,
LITERAL_RETURN,SLIST,LITERAL_SYNCHRONIZED,LITERAL_TRY,WILDCARD_TYPE,LITERAL_WHILE"/>
</module>
The examples were created with Eclipse-CS 6.14.0.

Related

Shopware 6 add entity extension fields to admin search

I wonder how to make some fields of an entity extension searchable in the administration through the "/api/search/my-entity" api-endpoint. By default they are not considered during search as it looks like.
I found the answer by debugging the search-endpoint:
The association-Field of the EntityExtension needs to have a SearchRanking-flag:
...->addFlags(new SearchRanking(SearchRanking::ASSOCIATION_SEARCH_RANKING))
Then you can add SearchRanking-flags in the EntityExtensionDefinition as you like, e.g.:
(new StringField('test', 'test'))->addFlags(new SearchRanking(SearchRanking::HIGH_SEARCH_RANKING)),
After that the fields are searchable via the search-endpoint :)
As far as the API is concerned, search functionality should automatically be generated following your custom entity definitions.
When it comes to facilitate Admin search for your entity, you need to add some code to the administration component as described in the docs: https://developer.shopware.com/docs/guides/plugins/plugins/administration/search-custom-data (even though it looks not fully up-to-date w.r.t to the current Shopware versions).

How to omit/exclude files by extension in Intellij Show Usages

In the following screenshot we see the results of selecting
Edit|Find|Show Usages
while highlighting a class SparkAbstractBenchmark: Notice we do not get any useful information because the log files overwhelm the source files
So is there a way to exclude *.log from the search ?
You might consider upgrading to the IntelliJ latest version, since in the newer versions the results are organized in sections that you can collapse/expand, I guess it could be usefull for this case, look:
If this is not enough (which is the case) you have the option to configure your own Scopes, just go to the Find Usages Settings and click the elipses in the Scope section, then click the + symbol to add a new (local) scope, name it and you should see this window:
Then in the Pattern: field you have to specify the pattern following the scope syntax which should be something like this:!file:*.log
After applying you should have this new Scope option available in the settings scopes list which you can use to filter the search.

What is Localizing SQL Repository Definitions in ATG?

I read the documents but i don't clearly understand what is explained in this link.
Can somebody explain in detail what it is and What the author tries to explain in that little explanation?
here is the link:
http://docs.oracle.com/cd/E23095_01/Platform.93/RepositoryGuide/html/s0901localizingsqlrepositorydefinitio01.html
When a user uses the BCC it picks up the language locale from their RequestLocale. This will then, using the standard Java Resource Bundle functionality, allow you to customise the labels next to each one of the elements inside the BCC.
As an example the following definition:
<table name="XXX_MEDIA_CATEGORY" type="auxiliary" id-column-name="MEDIA_ID">
<property name="buttonText" data-type="string" column-name="BUTTON_TEXT" display-name-resource="buttonText" category-resource="categoryBasics" default="GO BUTTON">
<attribute name="propertySortPriority" value="8" />
<attribute name="resourceBundle" value="atg.projects.store.StoreCatalogTemplateResources" />
</property>
</table>
If you have a StoreCatalogTemplateResources.properties file with the following property:
buttonText=Media Category Button
It will show up in the BCC editor for the Media Category Item as Media Category Button.
The localisation of the SQLRepository items only apply to the BCC editor and does not translate any of the value properties within the repository. To do this you will need to implement some sort of translation solution yourself (ATG 9.x does not come with a data localisation strategy out-of-the-box) though there were some available to purchase from 3rd party vendors. ATG 10.x has now implemented a working version localising repository data.
A resource bundle is a Java .properties file that contains locale-specific data (Resource bundles contain locale-specific objects.)
http://en.wikipedia.org/wiki/Java_resource_bundle
http://docs.oracle.com/javas/6/docs/api/java/util/ResourceBundle.html
In short, you can create a file with translation phrases that will be show when someone uses the repository when someone uses the Control Center’s Repository Editors.

How is the Trac Project List page customised?

We've been using Trac for a while now for our developers only. However we are now opening it up for our (internal) clients. We have a project listing page (based on the default one that comes with Trac). What we'd like to do, is display more information about the project than what is currently available.
I have searched google and here, to see if I can find how to get more information. There seems to be a variable called $project which has .name, .description and .href as attributes.
Is there somewhere, a list of the attributes available? Or perhaps a different solution altogether that will allow us to display more information on the project list page. Such as the number of open tickets etc.
As far as I known, you can use $project.env as well. It is an object, which provides a number of attributes:
$project.env.base_url
$project.env.base_url_for_redirect
$project.env.secure_cookies
$project.env.project_name
$project.env.project_description
$project.env.project_url
$project.env.project_admin
$project.env.project_admin_trac_url
$project.env.project_footer
$project.env.project_icon
$project.env.log_type
$project.env.log_file
$project.env.log_level
$project.env.log_format
More detail is available at env.py
On the project page customization page there is not much variables, indeed. Looking at the source code there is also trac.version, trac.time, but that's all. There is also project.env that may hold more information. I do not have a multiproject setup at hand, so you might be interested to see for yourself what variables are available with TracDeveloper plugin. It dumps variables if enabled and you add debug=true in the URL.

Plugin configuration in Eclipse

I'm investigating the use of Eclipse as a platform and I am trying to figure out how a plugin provides configuration. For example, say I have a plugin to display a user defined message. Further, I want that user defined message to be configured by the user. What is the standard way for the user to edit this message in the platform? Is there any documentation for this?
As you mentions in the comments, the article Preferences in the Eclipse Workbench UI described the way developers define preference pages for their plug-ins.
By use of the preference store in conjunction with the preferences dialog and provided field editors a plug-in developer can quickly put together a user interface for managing preferences.
The color preference page is an example of a simple page that uses a single JFace field editor to manage its values
That way, you can define several type of custom values configured by the user:
text field
set of predefined values (dropdown list)
array of values
Example:
Found it: http://www.eclipse.org/articles/Article-Preferences/preferences.htm Wow, Stackoverflow helps a lot! You only need to post and it magically comes up in Google
Sorry to VonC but I had already found it before he posted the answer :-/