selection

Range Selection and Mozilla

I would like to specify that firefox select a range. I can do this easily with IE, using range.select();. It appears that FFX expects a dom element instead. Am I mistaken, or is there a better way to go about this? I start by getting the text selection, converting it to a range (I think?) and saving the text selection. This is where I'm...

Remove All id Attributes from nodes in a Range of Fragment

Is there a way to remove the id attribute of every node in a range or fragment? Update: I finally found out that the bug I'm struggling with is based on a <[script]> being included in a range, and therefore unexpectedly cloned, when a chrome user does a ctrl+a. My goal would be to remove any instance of <[script]> from the range (or doc...

avoid preselection of a view when focus is gained android

Hi all, I don't know if the title is very clear, but my issue is as follows : I have an activity with a listview, and on top of this listview, i have a searchfield (edittext). The issue is that when i try debugging on a phone, the virtual keyboard gets out straight after the screen displays the activity... And of course, it's hidding h...

How to change colors for ListView, alternating row color?

I have a couple of list views, one uses TextViews laid out with xml, the other uses a custom class derived from View. The default halloween color scheme is pretty ugly. How can I change the background and selection colors for the list elements. Ideally, I'd like to be able to do this in code not xml, to handle the custom view. Thanks...

[JS] getSelection on DIV contentEditable

Hi all ! I am trying to achieve project and i must do a WYSIWYG editor in JavaScript. I can't use an existing editor because I need use my plugins (for example a colorPicker or imagePicker).. For this time I have this HTML : <div class="K_editor" id="idExample"> <div class="K_links"> <div class="K_editor_link K_editor_linkB...

How do I select a single cell in a WPF datagrid?

When I click a cell in a WPF datagrid, the whole row is selected, and when I press Ctrl + C to copy the content, the whole row i copied... How do I select and copy the content of a single cell? ...

Conversion of DOM element selection code to jQuery

I have a large Javascript codebase to convert to jQuery. The code is structured such that DOM elements are created in Javascript (using a library called DomBuilder), and saved to variables if they will be needed later, before being added to the DOM. Eg. var inputs = { submitConfirm: INPUT({type: 'button', value: 'Submit'}), su...

eclipse: calling organizeimports programmatcally

Hi, I'm trying to execute 'OrganizeImports' programmatically on files that I'm editing programmatically. My code looks like this: final ICommandService cmdService = (ICommandService)PlatformUI.getWorkbench().getService (ICommandService.class); if (cmdService != null) { final Command cmd = cmdService.getCommand(IJavaE...

How to select an element by Class instead of ID in ASP.NET?

I have a few scattered <p> elements on the aspx page which I am grouping together using a class like so - <p class="instructions" runat="server"> In my code behind, using C# I want to hide these elements, using something like instructions.Visible = false; However I realize I can only do this in codebehind if I use ID but this will res...

How to indicate to user that a command affects a subset of a multiple selection?

Here is an example that illustrates my question. I have a program that lists 1000 items. I select 10 of 1000 items. The program enables a button indicating that a command is available for my selection. I click the button, and a window appears. I make some change in the window and click OK. The command changes 5 of the 10 items in my ...

How do I wrap a repeatbale set of elements in jQuery?

In jQuery how would I go about wrapping a repeatable set of elements with a div? For example I have: img h4 p img h4 p img h4 p I need to wrap each img, h4, p set with a div class="container". So it will look like: <div> class="container"> img h4 p </div> <div> class="container"> img h4 p </div> <div> class="container"> img h4 p </div> ...

Swing: Programmatically select a text

Hey everyone, I have a very simple Swing GUI with just a JTetxtArea. I am trying to programmatically select a part of text using: textArea.select(startSelection,endSelection); This work. However as soon as I add some other components to the GUI I do not see selection anymore frame.getContentPane().add(button); frame.getContentP...

Firefox select text range

Hello guys, A quick question: how do I programatically select the text fragment of the page in FireFox? For example, there's a paragraph of text, user clicks the button and symbols from 10-th to 15-th are selected as if user dragged a mouse in a regular way. ...

Javascript: I can get the text of a selection, now how do I get the text outside the selection?

I have a bit of code that returns the text of a selection and I can assign that string to a variable, but now all I need are two variables, one for the text before the selection and one for the text after the selection. Here is the code for getting the selection: function findSelection(){ //returns the selection object. var userSele...

Multiple selection with GtkCombo

Hi. Somebody knows if it is posible to make a GtkCombo which allows multiple entries selection?In affirmative case how can i make this? ...

How to integrate a custom ISelectionProvider with Eclipse enabledWhen expressions?

I have a custom graphical EditorPart in a Eclipse RCP application. It sets a custom ISelectionProvider in the createPartControl(..) method: @Override public void createPartControl(Composite parent) { // [snip] getSite().setSelectionProvider((ISelectionProvider)model.getSelection()); } I have two ViewParts listening to selec...

How to Prevent SelectionChange in Silverlight DataGrid

I'm using a Silverlight 3 DataGrid control and have set the SelectionMode to Extended. The DataGrid takes care of managing the extended selection for me in an almost perfect manner out of the box, but a key piece of the logic is interfering with me. I have a cell that can function as a drag and drop thumb and initiate a drag operation b...

managing html rich text selections

Hi, I am writing a component for a web app which will display some html, and let me capture and manipulate the selection boundaries (of the text selected by the user). I have done this successfully (for Mozilla) with a simple div element using window.getSelection(). However, the browser selection API is different for IE. If I were to ...

Mouse interaction in ListBoxItem children (WPF)

I have a ListBox with an ItemTemplate that contains a control that interacts with the mouse. This interfers with the selection functionality of the ListBox, i.e. clicking a control does not select the item. This is because ListBoxItem sets the Handled property of the mouse event to true in OnMouseLeftButtonDown. I tried the following pr...

How can I select device to execute debug build on Xcode?

How can I select device to execute debug build on Xcode? ...