Can I change "OK" button style in Select Dialog to emphasized? - sapui5

anyone know if sapui5 provide solution/function to change button style in select dialog? I've checked the SAPUI5 sdk but there is none for this solution.

If you are OK with using "private" properties then you can use _oOkButton property of SelectDialog or else you can use _getOkButton function which also is kind of "private" and returns ok button instance.

Just use the instance of the Select Dialog and get all buttons using the following methods. Select Dialog is a dialog only, you can use the methods of sap.m.Dialog
Let say you have the instance of the dialog as oSlectDialog then
oSlectDialog.getButtons() - will return all the Buttons in the footer. You can use loop them and give custom class accordingly.
var oBtns = oSlectDialog.getButtons()
for(var b in oBtns) {
var oBtn = oBtns[b];//You can check for button instance, if you want to add custom class differently.
oBtn.addStyleClass("YourCustomClass");
}
You can also use the sap.m.Dialog methods like oSlectDialog.getBeginButton(), oSlectDialog.getEndButton().

Since UI5 1.62.0, the primary action OK (later renamed to Select) is automatically emphasized if the theme is sap_fiori_3.
https://openui5.hana.ondemand.com/#/entity/sap.m.SelectDialog/sample/sap.m.sample.SelectDialog
If it's not urgent, I'd suggest to avoid relying on private methods/ properties, but update to the latest UI5 version and themes.
Update: and since 1.70 (commit:1f421b0), the button is automatically emphasized in other supported themes too, such as sap_belize, sap_belize_plus
Related Github issue: https://github.com/SAP/openui5/issues/2254

Related

Override "Paste As" dialog

When I drag Class element onto my diagram there is a window fired "Paste Class1", where I can choose the drop type, such as "Link","Property","Instance (Object)" and so.
I need to change that behavior - when I drag from ProjectBrowser I need apply only drop type "Link" and hide any variants from end user. Is it possible to do that via addin or anything else ?
Sparx 13.5
No you can't change the behavior of that dialog.
What you can do in an add-in is overrule whatever the user chose after the fact, and make it into a link anyway. (e.g. deleting the instance from the model and set the elementID of the classifier in the DiagramObject instead)
There is also a checkbox option to only show this window when Ctrl-drag is used. That might help to avoid mishaps as well.

Remove 'Details' button from ProgressMonitorJobsDialog JFace

I am trying to remove the 'Details' button from the following ProgressMonitorJobsDialog:
I am running a org.eclipse.core.runtime.jobs.Job that opens the default Dialog. I have seen examples here of disabling the Cancel button, but I need to remove the third one and extending the default ProgressMonitorJobsDialog won't help, since it is invoked by the default UIJob class. Any ideas?
This dialog is usually ProgressMonitorFocusJobDialog displayed by ProgressManager. It isn't really possible to change the dialog without using internal APIs.
Instead of a Job you could use an IRunnableWithProgress and use ProgressMonitorDialog to run it. This dialog does not have the Details section.

How can I use mnemonics on JavaFX 8 Alerts

I would like to be able to add accelerator keys for the buttons that are provided as a part of the Alert Dialog Controls included with JavaFX.
I am unsure if this is possible using the standard alert types ERROR, INFORMATION, CONFIRMATION, WARNING?
I created my own login window - which doesn't use an Alert structure and it works as follows:
When the stage opens up.
Then when the user hits the "ALT" key:
I would like the ability to "Hot Key" the buttons on the Alerts in the system. However, I am unsure if I can use the standard alerts, or if I need to create my own, and if so, how should I do that.
I really would like to use the Dialogs natively, if at all possible.
Thanks.
As far as I understood your question, I think it isn't possible without some extra code.
Looking at the code of OpenJFX the labels of the buttons are localized and fixed.
You might just want to create some buttons on your own by using the apropiate constructor which takes some buttons where you can override the existing ones.
EDIT: after rethinking everything, I tried to recreate your problem. You can see that project on GitHub..
This is the special code:
public void showCustomizedAlertWindow() {
Alert a = new Alert(AlertType.CONFIRMATION, "some content text", ButtonType.OK, ButtonType.CANCEL, ButtonType.FINISH);
((Button) a.getDialogPane().lookupButton(ButtonType.FINISH)).setText("_finished");
a.show();
}
But be aware, you are removing localization-support of that buttons.

How to enable Next/back button in wizard page in eclipse?

In my wizard page, the Next and Back buttons are not visible. is there any method to be called to make that enable?
Thanks a lot in advance!
Did you add multiple Wizard pages to the wizard? If there is only a single page, it makes sense to remove the mentioned buttons.
Update:
If there are multiple pages, then look at the Wizard implementation, and check the needsNextAndPreviousButton method what it describes. If you have implemented the IWizard interface directly (and not using some convenience abstract class, such as Wizard), it is possible that you generated that method returning constant false.
If that did not help, I suggest looking at the tutorial http://www.eclipse.org/articles/article.php?file=Article-JFaceWizards/index.html
Check the needsNextAndPreviousButton method in the wizard constructor. If you've added pages in your wizard then check canFlipToNextPage, isPageComplete, and validate your page completion in these methods and enable/disable as well.

How do you programatically remove (not disable) a button from TinyMCE?

I can disable the table button using this:
tinyMCE.activeEditor.controlManager.get('divId_table').setDisabled(true)
but what I'm interested in is actually hiding it. Any idea on how to accomplish that?
Thank you!
First, you have to use the advanced theme.
Then, add this option in the TinyMCE init code.
tinyMCE.init({
...
theme_advanced_disable : "bold, justifyleft, justifyright"
});
I hope this might help someone.
source
list of elements' name here
I'm not familiar with TinyMCE myself, but since you appear to have javascript access to the element itself, all you need to do is set it's display property to "none".
document.getElementById("theButton").style.display = "none";
incase ur trying to hide a specific button, use the following code.
$('.mce_cut').hide() //hides cut button
lookup other button titles using firebug in case u wish to hide something specific.
Incase you are looking to hide specific editor's button, modifiy the jquery selector to select correct sibling/descendent.
alternately, try this ..
tinyMCE.activeEditor.controlManager.controls.ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords_cut.remove()
Note that ctl00_SPWebPartManager1_g_5005db96_e035_4197_a958_75f008b35061_ctl00_tbKeywords is my asp.net control's id. Don't bother about this if ur not using Asp.net serverside textbox control. In case you are.. <% theTextBoxID.ClientID %> gets u that.
Use the following (using jQuery; a non-jQuery approch is easily built):
var elem = $(ed.id+'_'+'divId_table')
elem.addClass('mceButtonDisabled');
elem.removeClass('mceButtonEnabled');