Difference between IE and IE.DomContainer - dom

What's the difference between
IE.DomContainer.Button(Find.ByText("sometext")).Click();
and
IE.Button(Find.ByText("sometext")).Click();
?

None - where else would you be looking for a button except for the DomContainer? The Button class uses the DomContainer and a finder to get a button.

'Button' is actually a virtual property of 'Document' which both IE and DomContainer inherit. So yes, this is the same thing (as stated by the previous answer). It might be worth it to look at the definitions of these classes, it might shed some light on how things relate.

Related

How can I see a list of class properties in ios8 documentation

It seems that Apple always trying to innovate, which is good, frequently makes an over the top effort breaking what was good before. One sample of this is API documentation.
Now with iOS8 the documentation is missing a section where it groups all properties of a class. Before iOS8, there was this section in the left part of the screen, where one could just click on it and see all the class' properties grouped.
The only -bad- workaround I found was to do a search for #property inside the documentation class, which is an awful documentation design.
Has anybody else found a better way to list all the properties of a class other than doing a search for #property?
Are you talking about the documentation in xcode?
If so, when you click on a key-word in the right section you can see all what you need. The section is call "Quick Help" and is a question mark in a circle.
Otherwise you can click on the key-word with the cmd button pressed, and xcode will bring you into the definition of that word.
Hope it help.

What does this icon in Eclipse mean?

I am referring specifically to the green plus sign in the screenshot below.
[edit] This is taken from "Outline" view, and I am coding in Java.
This might help:
What do the icons in Eclipse mean?
From the icon index, the plus means add, the C means public class, and the warning means that there is a java element warning.
So from what I can assume, it means you can add a new public class, but is warning you of possible problems with your current project.
The green + sign is an overlay that shows that the visibility of the class is set to public. The orange is a warning that there could be a potential issue in that class. This might not necessarily stop your class from running or performing well. It is just telling you to be aware of something that may or may not be harmful.

Custom Switch - Yes No Type - iPhone

Is there any chance of getting this above switch implemented? Any reference source would be helpful.
You can create Custom switch button with the Help of image. Create a switch button (Set Alpha below to 1) and place a image above UISwitch it will work perfect.
https://github.com/samvermette/SVSegmentedControl
https://github.com/samsoffes/sstoolkit
https://github.com/alinux/iPhone-custom-switch-UIView
This isn't going to be an answer to solve your question, as it is going to be more of a piece of UX advice.
This type of switch goes against Apple's HIG.
You should never display a segmented control or switch where the user will not be able to tell when the control/switch is "On" or "Off". If I were someone who hadn't used switches in an iOS application before, I would not be able to tell what's "On" or "Off" in the image above. It may be easy for you to determine this, but you need to consider the possibility of someone (with less intuition than you) using your application.
Hope this helps.
Take a look at this replacement UISwitch project.

GWT use of interface instead of widget

in a définition of a widget, what is a better practice, and why, use the widget himself or the type "higher", example, it's a better practice to do
1) Button myButton;
or
2) Hastext myButton; (and set a button later)
thanks for your answer.
It is usually a good idea to use "higher" types or interfaces. By doing this properly you can hide implementation details. The code that uses an object looks at it as the one of a higher type and it is not important what is actually hiding behind it. This is good because you can easily change an implementation of the object without breaking anything.
For example when defining a panel in an application you should use Panel class instead of its implementation e.g. HorizontalPanel or VerticalPanel.:
Panel myPanel;
Then you can create a proper implementation of it, e.g HorizontalPanel:
myPanel = new HorizontalPanel();
If you then later decide to change myPanel to be VerticalPanel you will not have to change anything in the code that uses myPanel. Everything will work just fine.
However you must remember that you will be only able to use methods available in Panel class. Additional methods defined in e.g. HorizontalPanel will not be accessible. And this is actually what you should remember when choosing the type of your widgets. Your widgets should be of types which provide methods which you want to use.
In your example using HasText instead of Button isn't probably a good idea because HasText has only methods for setting and getting a text and you probably also want to have access to addClickHandler method available in Button and a few more.
So to summarize it is good to use "higher types" but they should not be "too high" to be useful.
The answer to that lies in the Model-View-Presenter pattern, that was introduced in last years Google IO presentation by Ray Ryan. There's also an official tutorial/docs - part 1 and part 2. There are also a number of questions here on SO that cover that topic :)
And a quick answer to your question (that will make more sense once you get familiar with MVP): use interfaces in the Presenter and their implementations in the View :) That way your Presenter stays oblivious to the underlying implementation/Widget you actually used (was it a Button? Or a Label? It doesn't matter, they both implement HasText).

How to Create the Highlight/Note Popup Buttons from the iPhone Kindle

I am wondering how Amazon did the highlight/note popup buttons in the Kindle app. After reading about UIPasteboard, UIMenuController, UIResponder, and UIResponderStandardEditActions, I am able to turn on or off standard edit actions (i.e. copy, cut, paste, select, and selectAll). However I haven't found a way to add a custom action yet. I would really appreciate it if I could get a pointer.
Thanks in advance!
Chris
(source: sampletheweb.com)
Edited by balexandre (added image instead link)
It looks like Amazon implemented their own custom view that mimicked the appearance of UIMenuController. I believe they did this rather than use SPI because if you click and hold on the Highlight cell, the arrow does not highlight, when it does in the real UIMenuController.
I don’t think there is a public interface to these controls, you’d probably have to code them yourself. (Or maybe figure out the private API, but that’s a slippery slope.) I am not sure about that, though, maybe somebody will prove me wrong.
That's a good point about the arrow part of the Notes/Highlight popup menu not highlighting, so they must be implementing their own.
However they are also obviously using a UIWebView, because it's recognizing tap and hold and they can highlight the text, and you can't get touch events from a UIWebView, much less get the information about what's selected. So how are they doing that?
This would be very useful for us to be able to do as well.
Use DTMenuController http://www.drobnik.com/touch/2010/01/dr-touchs-parts-store/
Costs 100 EUR ^_^
Custom menu items can be added via the UIMenuController's menuItems property. See Apple's UIMenuController docs.
the javascript part can be managed with jQuery, that's a fair simple and powerful library. i'm using it for resizing and rearranging things in a webview and it works great :)