Intellij-IDEA: How to sort members alphabetically? - intellij-idea

I am using Intellij-IDEA 12. Most of team mates use Eclipse and while saving it sorts members automatically first based on Visibility and then Alphabetically. I want to mimic the same functionality in Intellij. But it seems that when I choose arrange members alphabetically, it overrides visibility (and all other) rules. How can I sort members based on Visibility (Public - Default - Private ) and within that sub-group sort them Alphabetically?
Edit: This assumption made in the question is wrong. Like mentioned in the Answer by #Maba, creating separate rows and marking them as "Order Alphabetically" works as expected. ( I had separate rows for fields but failed to create separate rows for Methods and hence the confusion.)

Create separate rows for the different method visibilities in the Arrangement part of the Code Style.

Related

Custom Code to repeat static row on a new group instance only

I have a report where the end user has an input section strictly for in person use. It is a row where they choose "yes" or "no", basically. The issue is that this section is based per group. So, for example, each group is a sales order, that order may have many pages, this "yes/no" section requirement is to only show on the first page of each group.
Note, I have tried to used the Previous function to hide the row, using a field a field from the header section, no luck there. I'm not a programmer by trade and more over don't have experience in VBA
I have exhausted my searches on Google and it doesn't seem like anyone has done this before. It may not be possible because in the row the fields are static texts and aren't referenced from a real dataset.
Appreciate any input or work around that could work, or solidify the fact this isn't possible in SSRS

How to click on a link in a specific row of dynamically loaded table

I have a table similar to below in a WPF application.
We are using Silk Test 17.5 using VB.NET.
Table is dynamically loaded based on latest data.
I need to click on 'Default' ( Link) for specific row.
e.g. I need to click on 'Default' link for Trump1 , Trump2 row.
How should I do it? All locators of default links are same and I cannot differentiate between them.
Is there any I can append First Name locator to Default to figure out which locator to click?
Tokci
SilkTest has a framework for supporting such custom controls and a nice tutorial here
Theoretically you would have to:
List all the methods on the control
From the previous listing (or by talking with the developers) look up the method to access the rows inside the control
Filter your rows and get the one which is interesting for you
From the row you can get the cell by following the same pattern(find out the method which gives acces to it, get it, filter)
Click on the Link
Of course as the tutorial tells you, if you do not want to always do these iterations you should create some higher level utilities where you can just get the Cell at once. Example: GetGridViewRowCell(gridView, cellRow, cellColumn) where cellRows can be a more sophisticated filter object where you describe which cell must have which value in order to identify the proper row
Assuming the table has a hierarchical structure similar to HTML, you should be able to do the following:
Locate a cell in the row you are looking for that is easy to find, e.g. //WPFDataGridCell[#text='Obama'].
From that cell, move up the hierarchy one step using ...
Now you're in the correct WPFDataGridRow, search down again for the row's "Default" link with //WPFHyperLink[#caption='Default'].
Putting it all together, you'll get a locator like //WPFDataGridCell[#text='Obama']/..//WPFHyperLink[#caption='Default'].
Of course this is only an example based on the information you provided, so if you try it, make sure to pick the attributes with Silk Test's locator spy to make sure you get the correct values.

Best way to handle multi-valued fields as a view/grid

In several notes applications, instead of handling related data as separate documents, if the size of the data is small (less than the 32k limit), I'll make several multi valued fields and display it in what I call a "List Panel". It's a table where each column displays one multi-value field. Since fielda(1) goes with fieldb(1) that goes with fieldc(1) there is a concept of rows. (I did a similar thing in my auditing routine discussed here )
It is always assumed that each field has exactly the same number of elements.
All the multi-value fields are then stored on the single document. This avoids several coding conventions that made my eyes bleed like having date changed, who changed it, new value fields for each field we wanted to audit. Another thing that this kept to a minimum was having to provide multiple fields for the same thing that locked you into a limit. Taxrate1, Taxrate2, Taxrate3, etc...
In my "Listpanel" the first column is a vertical checkbox. (One for each element in my lists) This is so I can select one item to bring up and edit, or select multiple values to delete "rows" or apply some kind of mass change to them.
What would be the best way to handle this under xPages to get this functionality? I tried making a table but am having the devil of a time to get the checkboxes to line up with their corresponding data items.
Views and dojo-grids seem to assume we're using a document for each row.....
This TableWalker may provide what you want http://www-10.lotus.com/ldd/ddwiki.nsf/dx/Tutorial-Introduction-to-XPages-Exercise-23
It was created when XPages was all very new, so it's SSJS rather than Java. But if you're comfortable wiith Java, converting it probably won't be a challenge.
You could use a repeat control to display the values and build a table using the table row tags in the repeat. You would want to calculate the id of the checkbox to be able to take an action on that selected row. The repeat var would be just one of your multi-value fields and you use the index of the repeat to get the value for that row from the other multi-value fields.

Turning Off Grouping In ObjectListView Turns Of Sorting

I am struggling to find information on a lot of small issues I'm starting to come across since recently integrating the ObjectListView into my application. I must admit, I love the control and it takes a lot of work away from me by having the control pretty much do everything that I need.
However, amongst a few issues that I've come across thus far, one is the fact that if I turn off grouping for individual columns it no longer allows me to sort these columns.
For example, my ListView control has an ID, Summary, Location, etc., etc. I currently run grouping on the ID because I attach a unique footer against every ID and it looks good. But, when I click on Summary, or Location it then groups all items by Summary or Location and therefore I end up with the group header but no footer anymore because the footer no longer corresponds with the ID.
What I want to achieve is to allow the user to click on any other column, but still maintain the group by ID and thus keep the footer against each item. I only want the items to sort, not group, but as mentioned, when I turn off the grouping against each column, it turns off the sort function.
UPDATE
Basically, looking at the screenshot below, I want to be able to click on the Priority Column Header (for example) to sort the list of object by Priority, but still maintain the Group By Ticket (with the Group Footer details). And basically be able to click on any Column header to sort the list but keeping the grouping by Ticket.
I have intercepted the OLV_BeforeCreatingGroups event to add:
e.Parameters.GroupByColumn = Ticket_ID
This now seems to maintain my grouping by Ticket no matter what Column header I click on, but I now loose the sort functionality.
Try setting AlwaysGroupByColumn to be the TicketId column. That will do the trick :)
Second attempt:
Thanks for the screenshot. I think I understand what you want. You are hoping that clicking on the header will sort the groups themselves. That's not the default behaviour, which is to sort the rows within each group.
To do what you are asking:
Listen for BeforeCreatingGroups event and fill in the GroupComparer property on the event argument block. This comparer controls the ordering of the groups.
The default group order is based on OLVGroup.SortValue. So you could install a GroupFormatter delegate and change the SortValue for each group so they are ordered in the manner you want.
In either case, you will need to use PrimarySort and PrimarySortOrder to know which column the user last clicked.

Access query using * and sort criteria on columns - how to make field show just column name?

What I am doing
I have a query in Access which as SQL view of:
SELECT Projects.*, Projects.MySortField
FROM Projects
ORDER BY Projects.MySortField DESC;
This query works fine and sorts my data correctly. It is also very, very clean to look at and to understand what is happening.
However, when I load it into my form, I have run into an unexpected problem. Prior to adding Projects.MySortField and the associated sorting, I was able to refer to MySortField as follows:
Me.Recordset("MySortField")
However, now that I've added it to the sort criteria, the query returns slightly difference fields as the record associated field is:
Me.Recordset("Projects.MySortField")
I refer to this somewhat often in VBA which is where problems happen.
What I am trying to do and why
I would like my stakeholders to be able to more easily add or modify sort criteria. Unfortunately some of these are also referred to in the code more explicitly, which means if at any time I want to add sort criteria to my list, it will also adopt the Projects.mFieldName syntax in the RecordSet, which means any code referring to that data will break.
This would be nice to avoid, obviously, and if it was possible to modify the query somehow to facilitate my users adding fields and not having to change any code that would be wonderful.
Specific Question
How can I include Projects.* and still have specific fields from that table for sorting but keep all RecordSet fields reflected as just the field name?
The problem you are running into is that by having Projects.* as well as a named field, you are ending up with two output fields of the same name. I'm not sure why you feel you must use "*" instead of just explicitly naming the fields (which is generally considered the best practice) which would allow you to sort without the problem.
If you want to stick with "*" then you need to uncheck the show box in the query grid for your named fields, which will allow you to have the field explicitly enumerated for sorting or use as a criteria.
The SQL view when you do this should look like:
SELECT Projects.*
FROM Projects
ORDER BY Projects.MySortField DESC;
You can use the unchecking of the show box trick for both sorting or for doing criteria when you are using "*".
You can refer to the sort field without the qualifying table name in the SQL. Here is what I am thinking.
SELECT Projects.*
FROM Projects
ORDER BY MySortField DESC;
This
SELECT Projects.*
FROM Projects
ORDER BY Projects.MySortField DESC;
can be done.
But if you insist on adding , Projects.MySortField,then
SELECT Projects.*, Projects.MySortField as whatever
FROM Projects
ORDER BY Projects.MySortField DESC;