I am writing an eclipse plugin using draw2d. I am creating a draw2d button using the constructor : Button(Image image). At some point I want to change the image on that button! I can not find a way of doing it. Can anyone help me please?
Kind Regards,
Kyriakos
You could do the following:
Button button = ...
Image newImage = ...
((Label) button.getChildren().get(0)).setIcon(newImage);
It's certainly not nice, but it seems to be the only option.
Can't be done. The function that sets the image on the button is Clickable.setContents, which is protected. There is nothing in the documentation telling why this was done... You can try to inherit from Button and adding a new function to implement this.
Related
I am working with leaflet api.I can draw rectangles and polygons.I have bound the popup with every rectangle and polygon.When i click on drawn shape, popup opens(leaflet functionality).Popup contains some html(image).
As i am working on a demo application, i am wiling to try the fancebox plugin.
Means, when i click on drawn shape, instead of popup, i want to open up that image using fancybox.
Can i do that using simple method like using another function instead of .bindpopup.
Working Script (image loaded using fance box when we click on popup)
e.layer.bindPopup("<a class='fancybox' rel='group' href=''><img /></a>");
I can understand there must be some other javascript function to do it.
If there is some way to do it please let me know, as i am new to leaflet didn't have enough mental power to understand it yet but i hope i will....
Thanks for your time :)
I would just do e.layer.on('click', function() { //do fancybox init, perhaps like $(body).append("<a class='fancybox' rel='group' href=''><img /></a>")})
Although it makes a lot more performance sense to bind that event on the L.FeatureGroup holding all the shapes instead of one by one.
I have a problem with Flickity plugin. I want to use this one mixed with svgLoader plugin. The slider animation does't work correctly because you need to resize the window for refresh flickity plugin.
You can try it here : http://thibaut-lalanne.com/
Thx
You can manually refresh the slider anytime.
yourFlickitySlider.resize();
Resize the carousel and re-position cells like so:
// jQuery
var $carousel = $('.carousel').flickity()
$carousel.flickity('resize')
// vanilla JS
var flkty = new Flickity('.carousel');
flkty.resize()
For examples see: https://flickity.metafizzy.co/api.html#resize
I want to Make a Help Dialogue Box. When we Press Help Menu then Dialogue box will appear.
Current code is
h_opt3 = uimenu('Label','&Help');
uimenu(h_opt3,'Label','How to Use','Callback','dialog','separator','on');
It only show empty dialog.
In place of dialog i want to put a dialogbox which will describe how to use my software.
How to code this all. Please help.
Requirements: How to Add stuff in DialogBox and how to call it in above mention scenario.
Try writing an additional callback function, and look at helpdlg instead of dialog.
I can't test any code now, but something like the following should work.
function help_callback
h = helpdlg('Directions','title');
end
Then change your uimenu call to this code
uimenu(h_opt3,'Label','How to Use','Callback',#help_callback,'separator','on');
Is it possible to click on an image, that is not located in a specific container element?
When I do have a container, I use something like this:
MyRepo.AnyForm.AnyElement.Click(new Location(Imaging.Load(anyPicture.bmp)));
and that works very well.
But now, I want to click on a menu item inside some context menu that Ranorex is not able to identify. So I want to let Ranorex easily search the whole screen for the target image.
Something like this:
AnyElementThatRepresentsTheWholeScreen.Click(new Location(Imaging.Load(anyPicture.bmp)))
Thanks and regards,
fachexot
I've found it. Here the solution if someone has the same problem:
Host.Local.Click(new Location(Imaging.Load(anyPicture.bmp)));
I have image in GridItem. I am able to find the GridItem and Image.I am not able to Click it from my UI Automation Sample.I am doing it in c++
IUIAutomationElement* p1
.......
.......
POINT clickable;
BOOL gotClickable;
hr = p1->GetClickablePoint(&clickable,&gotClickable);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,clickable.x,clickable.y,0,0);
I'm doing a plugin in Eclipse IDE in order to do a refactoring. I'm using LTK, the point is: I don't know how I can disabled the back button after the preview. I've tried to create the RefactoringWizard using some flags like 'NO_BACK_BUTTON_ON_STATUS_DIALOG', but I think it is not the rigth way to do it.
The poblem I have in the background is that when I push preview and then push back, and preview again, the preview box shows the change related with the refactoring twice!.
I think the best solution is disabling the back button after the preview because this is the solution I have seen in others plugins.
Sorry because of my English and thanks beforehand.
The method org.eclipse.jface.wizard.WizardDialog#updateButtons disables the back button when currentPage.getPreviousPage() returns null. So, I suggest you to override the method org.eclipse.ltk.ui.refactoring.RefactoringWizard#getPreviousPage to return null.