There are 9 code examples for org.eclipse.swt.events.FocusEvent.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: OpenII Package: org.mitre.openii.editors.unity
Source Code: ClickListener.java (Click to view .java file)
Method Code:
public void focusLost(FocusEvent fe){
if (!unityCanvas.selectedItem.isDisposed()) {
Term theTerm=unityCanvas.getVocabulary().getTerm((Integer)(unityCanvas.selectedItem.getData("uid")));
String text=((StyledText)unityCanvas.getEditor().getEditor()).getText();
if (!text.equals(theTerm.getName())) {
theTerm.setName(text);
unityCanvas.updateTables(new Integer[]{(Integer)unityCanvas.selectedItem.getData("uid")});
}
unityCanvas.getEditor().getEditor().dispose();
}
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.browser
Source Code: WebBrowserView.java (Click to view .java file)
Method Code:
private void createLocationInput(Composite parent){
if (Application.IS_WINDOWS || Application.IS_LINUX) fLocationInput=new Text(parent,SWT.BORDER | SWT.SINGLE | SWT.SEARCH);
else fLocationInput=new Text(parent,SWT.BORDER | SWT.SINGLE);
OwlUI.makeAccessible(fLocationInput,Messages.WebBrowserView_ENTER_WEBSITE_PHRASE);
fLocationInput.setMessage(Messages.WebBrowserView_ENTER_WEBSITE_PHRASE);
fLocationInput.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true));
if (fInput.getUrl() != null) fLocationInput.setText(fInput.getUrl());
fLocationInput.addSelectionListener(new SelectionAdapter(){
@Override public void widgetDefaultSelected( SelectionEvent e){
if (StringUtils.isSet(fLocationInput.getText())) {
String link=URIUtils.getLink(fLocationInput.getText());
fBrowser.setUrl(link);
if (fInput != null) fInput.setCurrentUrl(link);
fBrowser.getControl().setFocus();
}
}
}
);
fLocationInput.addMouseListener(new MouseAdapter(){
@Override public void mouseUp( MouseEvent e){
if (fLocationSelectAllOnce && fLocationInput.getSelectionCount() == 0) fLocationInput.selectAll();
fLocationSelectAllOnce=false;
}
}
);
Controller.getDefault().getContextService().registerInputField(fLocationInput);
fLocationInput.addFocusListener(new FocusListener(){
public void focusGained( FocusEvent e){
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(true);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(true);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(true);
}
public void focusLost( FocusEvent e){
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
fLocationSelectAllOnce=true;
}
}
);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.browser
Source Code: WebBrowserView.java (Click to view .java file)
Method Code:
public void focusLost(FocusEvent e){
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fEditorSite.getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
fLocationSelectAllOnce=true;
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: FilterBar.java (Click to view .java file)
Method Code:
public void focusLost(FocusEvent e){
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
fSearchSelectAllOnce=true;
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: BrowserBar.java (Click to view .java file)
Method Code:
private void createLocationInput(Composite parent){
if (Application.IS_WINDOWS || Application.IS_LINUX) fLocationInput=new Text(parent,SWT.BORDER | SWT.SINGLE | SWT.SEARCH);
else fLocationInput=new Text(parent,SWT.BORDER | SWT.SINGLE);
OwlUI.makeAccessible(fLocationInput,Messages.BrowserBar_ENTER_WEBSITE_PHRASE);
fLocationInput.setMessage(Messages.BrowserBar_ENTER_WEBSITE_PHRASE);
fLocationInput.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,true));
fLocationInput.addSelectionListener(new SelectionAdapter(){
@Override public void widgetDefaultSelected( SelectionEvent e){
if (StringUtils.isSet(fLocationInput.getText())) {
fBrowser.setUrl(URIUtils.getLink(fLocationInput.getText()));
fBrowser.getControl().setFocus();
}
}
}
);
fLocationInput.addMouseListener(new MouseAdapter(){
@Override public void mouseUp( MouseEvent e){
if (fLocationSelectAllOnce && fLocationInput.getSelectionCount() == 0) fLocationInput.selectAll();
fLocationSelectAllOnce=false;
}
}
);
Controller.getDefault().getContextService().registerInputField(fLocationInput);
fLocationInput.addFocusListener(new FocusListener(){
public void focusGained( FocusEvent e){
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(true);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(true);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(true);
}
public void focusLost( FocusEvent e){
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
fLocationSelectAllOnce=true;
}
}
);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: BrowserBar.java (Click to view .java file)
Method Code:
public void focusLost(FocusEvent e){
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fFeedView.getEditorSite().getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
fLocationSelectAllOnce=true;
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.search
Source Code: StateConditionControl.java (Click to view .java file)
Method Code:
@Override public void focusLost(FocusEvent e){
newStateToolTip.setVisible(false);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.services
Source Code: ContextService.java (Click to view .java file)
Method Code:
public void focusLost(FocusEvent e){
activateNavigationContext();
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.views.explorer
Source Code: BookMarkSearchbar.java (Click to view .java file)
Method Code:
@Override public void focusLost(FocusEvent e){
fViewSite.getActionBars().getGlobalActionHandler(ActionFactory.CUT.getId()).setEnabled(false);
fViewSite.getActionBars().getGlobalActionHandler(ActionFactory.COPY.getId()).setEnabled(false);
fViewSite.getActionBars().getGlobalActionHandler(ActionFactory.PASTE.getId()).setEnabled(false);
}