Show but disable a view in Eclipse-RCP - eclipse-plugin

I have two views in my RCP application, wherein I'm performing a task(background operation),the status of the operation is shown in view1. What I'm trying to achieve is that,during the task in progress, user shouldn't able to move/traverse to other views.They(other views) should be disabled.
As a workaround i tried using the showView method of IWorkbenchPage.
activePage.showView(view.ID,null,IWorkbenchPage.VIEW_VISIBLE);
I've used the three constants VIEW_VISIBLE,VIEW_ACTIVATE,VIEW_CREATE. None worked in my case though.By the way in showView method signature, i could not figure out what is a secondary id.
Below is the simulated demo of my problem
here the user can traverse to view Demo,during the operation, which shouldn't be actually.
How can i resolve this, any ideas please?

You can't really disable a view (there is no notion of "disabled views"). The only thing you can do is hide it. Use the hideView() method to do that.

Another way of doing it would be to use the ProgressService to display a modal progress dialog while the operation is progressing. This way the user must wait until the operation is complete before they can interact with the UI.
PlatformUI.getWorkbench().getProgressService().run(true, false, runnable);
See http://wiki.eclipse.org/FAQ_Why_should_I_use_the_new_progress_service%3F

You can disable a view like you disable any other SWT control: by setting setEnabled(false) on the top Composite. Often done by overriding ViewPart.showBusy(...)...

Related

How to track when a user views a JIRA issue

In my plugin I need to track when a user views an issue using UI. Ideally I'd like to know if it was opened directly, or was viewed in Issue Navigator Detail View. I need to track who and when viewed an issue.
What's the best way to do this?
Cheers,
Oles
The most straightforward way would be to use a Servlet Filter plugin module and scan the requested URL for those corresponding to issue views. You can generally distinguish between viewing the issue directly and a view from within the Issue Navigator by examining the query parameters.
Alternatively, you could also build a Web Panel plugin module that renders no significant UI, but which would always be invoked when an issue is viewed. You'd probably want to position the web-panel on the right side of the issue view with atl.jira.view.issue.right.context.
In either scenario above, you can fetch the current user from an injected JiraAuthenticationContext.

GWTP - Identify when Presenter is removed from Slot

I want to add a confirmation popup when a user navigates away from one of my presenters and is replaced in a NestedSlot. Can I intervene before a place is revealed and check the current presenter?
Edit: I just learned that the PlaceManager has some support for this using the setOnLeaveConfirmation method. That said, I still don't think this will work for my case because I want the confirmation popup to be associated with a single nested presenter. I would also prefer to manually intervene because I already have a confirmation modal for a cancel button that I want to reuse.
It would have been simple if you could override window.confirm() using GQuery the same way as you can in JQuery, however that's not the case. Your best option is still using placeManager.setOnLeaveConfirmation(). You could probably emulate the same behaviour as window.confirm() with a PopupWidget, but then it wont block access to other parts of the page.

Altering the check-in dialogue in ICN (IBM Content Navigator)

In IBM Content Navigator, The "Check In" dialogue contains a Properties Pane, that in turn contains a Class Selector drop down box.
ClassSelector image
I want to keep the check-in functionality, but would like to have that Class Selector box not appear (There is no use case where a user would need to change the document class).
What would be the proper way to achieve this?
Is there a way to extend the ecm/widget/CheckInDialogue.js file AND make the default checkIn action use my new js?
Do I need to create a brand new checkIn action that references a new js?
Do I just change the ICN shipped js/html?
Just to clarify, I do know how to create a plugin, and how to create a js extension to the checkinDialogue.js, and how to remove the classSelector; however I don't know how to make the checkin action use my new script, or the best way to accomplish this.
Thanks!
Before answering your question, I would like to say that I think there is other options to do this without customizing ICN. The two easiest I can see would be:
Use entry templates, that way class selector will be disable on check in by default
Remove the privChangeClass privilege, that should hide the Class Selector (might be difficult if you want to leave full priv.)
Now if you want to hide it without using entry templates or privileges.
Yes, extend the ecm.widget.layout.CommonActionHandler and overwrite the actionCheckIn function and use your CheckInDialog instead of the default one. Then use your CommonActionHandler instead of the default one in your desktop. I don't think there is a way to change the ActionHandler from the admin desktop UI yet (if I missed it please let me know), although it's loaded by the client on the _loadDesktop function and set by the appearance tab but the value is hard-coded, so you might have to inject it after the load of better, call ecm.model.desktop.setActionHander(actionhandler) where actionhandler is the instance, not the class name (string) in a plugin.
You can, this will make things easier to manage if you have several desktops and you want some to use your new Check In dialog and some not.
No, that's a terrible idea :) Future upgrade of ICN and your code will be a nightmare and the delivery process a lot more complex than a simple configuration trick or ICN plug-in, that's what plug-ins are for.
Also a not so clean but really simple solution would be to aspect after the CheckInDialog.prototype on the postCreate function and do a domStyle.set(this.addContentItemPropertiesPane._contentClassSelectorDiv, "display", "none"); to just hide it on all CheckInDialogs.

Create and use global view in C# WP8 XAML

I was trying to digg something on this topic before, but have no luck. What I'm trying to achieve is pretty simple, but seems to be hard to achieve :-)
I have a WP8 app (C# XAML) and I need to implement global messages (something like toasts) which could be displayed across whole application no matter of current navigation processes. Such toast message(s) should be displayed even while user is navigating between pages. To use the built in toasts is not a way (in case some other solution exists) since I'm possibly in need to have more than one message displayed at the same time (each one is independent of another) and should disappear after specified period of time.
So, my question is. Is there any way how to implement and use some kind of global view instance which sits above all pages and can be called from any page?
All I found until now is the possible ability to use PhoneApplicationFrame, but I would like rather avoid that if possible. I'm still unsure if this is even the way it can be done, but I suppose so. Do you have any alternatives or assurance this is possible and only way to achieve this goal?
Thank you all for your time and answers.
You can have UerControl for the Functionality you are looking for. It is Control that has its own Seprate Xaml and cs file. You can call it from any page into your Project. UserControl provides the base class for defining a new control that encapsulates related existing controls and provides its own logic. You have a XAML file and C# class file for a user control. The class file extends the UserControl class and adds additional behaviours and properties. The XAML file encapsulates the composing controls, the styles, the templates, animations and whatever necessary to form the UI. Since it is a just composition, it is really easy to create. for more Reference you can go here Why and how to create a User Control in Windows Phone
I have ended up rolling my own custom navigation using a single master page. As such any global controls are instantiated once at startup. Navigations are called from my viewmodels and result in usercontrols being removed and added to the visual tree as necessary (using transition animations to give the impression of page navigation) This works but im not sure whether it is best practice and would appreciate some opinions and comments on this. Certainly it solves the problem of global views described.

How to create wizard/screens with disabled pages/buttons using Dojo Dijit?

I want to create a sequence of screens using a StackContainer in Dijit.
However, I want to disable consecutive pages and their corresponding buttons in the StackController until the form on the current page has been validated successfully.
Is this possible with the standard elements? If so, how?
In addition, it would be nice if I could customize the buttons of the StackController to show my own details instead of the title of the screen.
For disabling I think you can use
the_button.set('disabled', true); //and vice-versa
For changing the details you can try setting the labels directly (similar to disabled) or try subclassing the appropriate stuff (probably the stackcontroller) if it turs out to be feasible.