(DOORS/DXL) Possible to use DXL to open new windows of modules? - scripting

Is it possible to use DXL to programmatically open up a module in a new window?
Also, would it be possible to programmatically scroll to a defined object in a module?
If so for either of these, can you please point me to functions or methods I should use?
Thanks,
Phil

Yes you can do both of those
Module m = read("/PROJECT/MODULE NAME", true)
Object o = object(THE_OBJECT_ID, m)
current = o
refresh m
THE_OBJECT_ID is just the number of the object you want the focus to be on.
Let me know if you run into any problems.

Related

How can I change the program header in sap abap?

I want to change the header name of the ABAP program. What can I do or where can I find the option to edit the header?
Two ways for this:
Set it in program options. Select the program and check menu Goto / Attributes.
Or you can create a GUI title and set it via ABAP. This overwrites attributes' setting.
More about how to achieve: here.
To change the program header is more easier than it seems.
Just open you program via SE38 -> Goto -> Properties -> Check the title field and change -> Save
And you are done. :)
I have this.
Usually is changing the name in atributes with transaction se38, but sometimes this don't work, you need in the transaction se80, create a title GUI, if yuou don't have a title created, righ clic in the program name, create -> GUI title.
And put your name and code.
and in your program (se38) in PBO, you have to call the title with
SET TITLEBAR '100' (Put your title code)
(100 is the title code), but this instruction have to need inside of a moodle, if is outside don't will work.
I use the first moodle that i have in my PBO (i don't know if is the best decition or the right form, but is a way and works).
finally the title change
The path is SE38 -> (Put Program Name) -> Now open the program in edit mode -> Select the option GOTO -> select Properties Change the program title.

Is there a way to quickly generate a foreach for an existing variable using live templates?

I have the following code snippet:
Set<Company> companiesByUserName = companyUserService.getCompaniesByUserName(username);
Using IntelliJ live templates, I know I can type "itco" and it will generate the following for me:
for (Iterator<Company> iterator = companiesByUserName.iterator(); iterator.hasNext(); ) {
Company next = iterator.next();
}
However, how can I automatically create a foreach with the 'companiesByUserName' variable instead? So I want it to generate this automatically:
for (Company company: companiesByUserName) {
}
Because the foreach is a lot cleaner that iterating through the collection in a for loop, I generally use those instead, so would like to auto generate them if possible.
There is also a new feature introduced with IJ 13, called postfix completion. With that, you can type companiesByUserName.for and hit TAB (and obviously much more as per your defined templates):
Nevermind, found out how to do it. Just type "iter" and press enter.
Type "iter" then press tab. Idea is smart enough to pick collection to iterate through.

How to automate a splitButton using Rautomation ( adapter msuia)

I am trying to automate IE11 notification bar ( while downloading file) using Rautomation. Using MSUIA adapter I am able to catch the the save button. But I want to use Save As to supply the file location and name. But I cannot do that.
When seeing with UIspy I see that there is a splitbutton with name "Save". This splitbutton has another child splitbutton with name "" ( which is basically the down arrow) - I am not able to get to this control.
iemainwindow_local = RAutomation::Window.new(:class=>"IEFrame" , :adapter => :ms_uia )
ienotificationbar_frame = iemainwindow_local.child(:class=>"Frame Notification Bar")
ienotificationbar = ienotificationbar_frame.child(:class=>"DirectUIHWND")
if ienotificationbar.exists?
ienotificationbar.activate
sleep 1
mycontrol = ienotificationbar.control(:value =>"Save")
mycontrol2= mycontrol.control(:children_only => true)
mycontrol2.exist?
mycontrol.click
end
Getting error at this line mycontrol2= mycontrol.control(:children_only => true)
undefined method `control' for #<RAutomation::Adapter::MsUia::Control:0x4108e60>
Any idea how to get over this block?
I understand that there should be a menu and menuitems associated with the splitButton and when I click on down arrow besides Save, at UISpy I see that menu/ menu item is getting created directly under Desktop window ( though the processID is same ) - how to catch the menuitem Save as?
The Problem
Unfortunately, the :ms_uia adapter for RAutomation is not able to do this in its current form. I know this because I have written a lot of the UIA adapter for it :) The problem is that the current API doesn't allow you to really walk the tree like that (as you found out) because the Control class doesn't have a #control method. If the "Save" button had a native window handle, you'd be able to do this:
ieframe = RAutomation::Window.new(class: 'IEFrame')
save = RAutomation::Window.new(hwnd: ieframe.control(value: 'Save').hwnd)
save.control(index: 0)
Since it does not, unfortunately there isn't a reliable way to get down to it that I am aware of since it doesn't have any identifying properties about it (other than being a child of the "Save" button).
Alternative
I've written another gem called uia, which acts as a low-level wrapper around UI Automation and allows you to work more closely with UI Automation and interact with it how you see it within tools like UI Spy. Eventually, I will use this gem in RAutomation but have not had the time yet. To get down to the "Save As..." split button control in your circumstance, you can do this:
ieframe = UIA.find_element(title: /Thanks for downloading/)
save_as = ieframe.find(name: 'Save').find(control_type: :split_button)
save_as.as(:invoke).invoke
The save_as.as(:invoke) will treat the found "Save As" Element as something that implements the Invoke pattern, and then you can call the #invoke method to get the menu to pop.
Hope this helps!

netbeans rcp adding to topcomponent at runtime

I am working on a netbeans RCP desktop application and have a need to add components dynamically. For example, I have a button which if I click on the menu should add components to the window at runtime. I have an actionlistener for the button and I added the following code in the action performed, but am not seeing the new component added. Any help is appreciated.
TopComponent editorTopComponent = WindowManager.getDefault().findTopComponent("componentId");
editorTopComponent.add(new JButton("TEST"));
editorTopComponent.validate();
editorTopComponent.repaint();
editorTopComponent.updateUI();
Thanks
If you want create now instance (more then one), then you can use :
MyTopComponent my = new MyTopComponent();
my.open();
my.requestActive();
if you want open TC in one instance (only), then you can use:
TopComponent editor= WindowManager.getDefault().findTopComponent("componentId");
if(editor!=null){
JPanel x =editor.getMyPanel();
x.setVisible(false);
//some changes
x.setVisible(true);
if(!editor.isOpened())editor.open();
}
Jirka

select all the entries in a checkedTreeselectionDialog

I am using org.eclipse.ui.dialogs.CheckedTreeSelectionDialog, to display a list of values. I want to select(check) all the values by default. Can you please let me know how this can be done.
You can set which nodes are checked initially (on dialog creation), by using the setInitialElementSelections method.
CheckedTreeSelectionDialog dlg = new CheckedTreeSelectionDialog(shell,
new cLabelProvider(),
new cContentProvider());
dlg.setInput(model);
dlg.setInitialElementSelections(model.getAllElements());
Also, make sure that you do your
dlg.setInitialElementSelections(model.getAllElements());
before you open your dialog:
dlg.open(); because otherwise it won't work.