当前位置: 首页>>代码示例>>Java>>正文


Java Focusable类代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Focusable的典型用法代码示例。如果您正苦于以下问题:Java Focusable类的具体用法?Java Focusable怎么用?Java Focusable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Focusable类属于com.google.gwt.user.client.ui包,在下文中一共展示了Focusable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: focus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
private boolean focus(int row, int col) {
	if (!getRowFormatter().isVisible(row) || col >= getCellCount(row)) return false;
	Widget w = super.getWidget(row, col);
	if (w == null || !w.isVisible()) return false;
	if (w instanceof SmartTableCell) {
		return ((SmartTableCell)w).focus();
	} else if (w instanceof HasFocus) {
		return ((HasFocus)w).focus();
	} else if (w instanceof Focusable) {
		((Focusable)w).setFocus(true);
		if (w instanceof TextBoxBase)
			((TextBoxBase)w).selectAll();
		return true;
	}
	return false;
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:UniTimeTable.java

示例2: activateWidget

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
@Override
public void activateWidget(WidgetToShow widgetToActivate) {
  final Tab tab = widgets2Tabs.get(widgetToActivate);
  if (tab != null) {
    selectTab(tab);
  }

  IsWidget widget = widgetToActivate.getWidget();
  widgetsPanel.showWidget(widget.asWidget());
  if (widget instanceof Focusable) {
    ((Focusable) widget).setFocus(true);
  }

  // add 'active' attribute for active widget for testing purpose
  for (WidgetToShow widgetToShow : widgets2Tabs.keySet()) {
    widgetToShow.getWidget().asWidget().getElement().removeAttribute("active");
  }
  widget.asWidget().getElement().setAttribute("active", "");
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:SubPanelViewImpl.java

示例3: ready

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
private void ready () {
	btnUpdate.getElement().setInnerSafeHtml(
			WizardDialog.WizardDialogTemplates.INSTANCE
					.nextButton("Update"));

	// enable properties
	btnUpdate.setEnabled(true);

	if (propertyWidgets != null) {
		for (Widget widget : propertyWidgets) {
			if (widget instanceof Focusable) {
				((Focusable) widget).setFocus(true);
				break;
			}
		}
	}
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:18,代码来源:PropertiesPage.java

示例4: setFocus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
protected boolean setFocus(final HasWidgets container,
                           Boolean found) {
    for (final Widget w : container) {
        if (w instanceof CloseButton) {
            continue;
        } else if (w instanceof Focusable) {
            ((Focusable) w).setFocus(true);
            found = true;
        } else if (w instanceof HasWidgets) {
            found = setFocus(((HasWidgets) w),
                             found);
        }
        if (Boolean.TRUE.equals(found)) {
            break;
        }
    }
    return found;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:BaseModal.java

示例5: setEditor

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
public void setEditor(Widget aEditor) {
	editor = aEditor;
	if (editor == null || ((editor instanceof HasValue<?>) && (editor instanceof HasText))) {
		valueHost = (HasValue<C>) editor;
	} else {
		throw new IllegalArgumentException("Editor must implement interfaces HasValue<?> and HasText");
	}
	if (editor instanceof Focusable) {
		focusHost = (Focusable) editor;
		focusHost.setTabIndex(1);
	}
	if (editor != null){
		CommonResources.INSTANCE.commons().ensureInjected();
		editor.getElement().addClassName(CommonResources.INSTANCE.commons().borderSized());
	}
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:17,代码来源:WidgetEditorCell.java

示例6: AutoSizingBase

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
public AutoSizingBase(T box, S shadow) {
this.box = box;
this.shadow = shadow;

	box.addKeyDownHandler(this);
	box.addKeyUpHandler(this);
box.addValueChangeHandler(this);

div.setStyleName("gwt-traction-input-autosize");
shadow.setStyleName("gwt-traction-input-shadow");

// make sure the shadow isn't in the tab order
if (shadow instanceof Focusable) {
    // we can't use -1 because FocusWidget.onAttach looks for
    // that and sets it to 0. any negative value will remove
    // it from the tab order.
    ((Focusable) shadow).setTabIndex(-2);
}

// note this has to be in a FlowPanel to work
div.add(box);
div.add(shadow);

initWidget(div);	
   }
 
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:26,代码来源:AutoSizingBase.java

示例7: setEditor

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
public void setEditor( T editor, boolean fShowCancel )
{
	m_table.clear();

	m_editor = editor;

	if( m_editor != null )
	{
		m_table.setWidget( 0, 0, m_editor );

		if( m_editor instanceof HasKeyUpHandlers )
			((HasKeyUpHandlers) m_editor).addKeyUpHandler( this );

		if( m_editor instanceof Focusable )
			((Focusable) m_editor).setFocus( true );
	}

	m_table.setWidget( 0, 1, m_okBut );
	if( fShowCancel )
		m_table.setWidget( 0, 2, m_cancelBut );
}
 
开发者ID:ltearno,项目名称:hexa.tools,代码行数:22,代码来源:Validator.java

示例8: requestFocus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
private static void requestFocus(final Focusable widget) {
  Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

    @Override
    public void execute() {
      widget.setFocus(true);
    }
  });
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:10,代码来源:DialogBox.java

示例9: setFocus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
private void setFocus( final Widget w ){
	if( w instanceof Focusable ) {
		Scheduler.get().scheduleDeferred( new ScheduledCommand(){
			public void execute(){
				((Focusable) w).setFocus(true);
			}
		});
	} else {
		Window.alert("Trying to set focus to an unfocusable Widget!");
	}
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:12,代码来源:ActionGridDialog.java

示例10: show

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
/**
 * Displays the {@link Window} popup. The popup will animate into view.
 *
 * @param selectAndFocusElement an {@link Focusable} to select and focus on when the panel is
 *     shown. If null, no element will be given focus
 */
public void show(@Nullable final Focusable selectAndFocusElement) {
  setBlocked(false);

  if (isShowing) {
    setFocusOn(
        selectAndFocusElement); // the window is displayed but focus for the element may be lost
    return;
  }

  isShowing = true;

  // Attach the popup to the body.
  final JsElement popup = view.popup.getElement().cast();
  if (popup.getParentElement() == null) {
    // Hide the popup so it can enter its initial state without flickering.

    popup.getStyle().setVisibility("hidden");
    RootLayoutPanel.get().add(view);
  }

  // The popup may have been hidden before this timer executes.
  if (isShowing) {
    popup.getStyle().removeProperty("visibility");
    // Start the animation after the element is attached.
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              @Override
              public void execute() {
                // The popup may have been hidden before this timer executes.
                view.setShowing(true);
                setFocusOn(selectAndFocusElement);
              }
            });
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:43,代码来源:Window.java

示例11: focus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
public boolean focus() { 
	Widget w = getWidget();
	if (w instanceof UniTimeWidget<?>)
		w = ((UniTimeWidget<?>)w).getWidget();
	if (w instanceof Focusable) {
		((Focusable)w).setFocus(true);
		if (w instanceof TextBox)
			((TextBox)w).selectAll();
		return true;
	}
	return false;
}
 
开发者ID:UniTime,项目名称:unitime,代码行数:13,代码来源:SimpleEditPage.java

示例12: getTabIndex

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
@Override
public int getTabIndex() {
	if (decorated instanceof Focusable) {
		return ((Focusable) decorated).getTabIndex();
	} else
		return -1;
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:8,代码来源:DecoratorBox.java

示例13: focus

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
private void focus(FocusGVO focusGVO, UIObject sender, String appId, String windowId, String eventSessionId) {
	String componentId = focusGVO.getComponentId();
	List<UIObject> uiObjects = getUIObjects(componentId, appId, windowId, eventSessionId);
	if (uiObjects == null) {
		return;
	}
	for (UIObject uiObject : uiObjects) {
		if (uiObject instanceof Widget) {
			makeParentVisible((Widget) uiObject);
		}
		if (uiObject instanceof Focusable) {
			((Focusable) uiObject).setFocus(true);
		}
	}
}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:16,代码来源:FocusHandler.java

示例14: execute

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
public void execute(BuiltInFunctionGVO builtInFunction) {
		if (builtInFunction instanceof FocusGVO) {
			FocusGVO focus = (FocusGVO) builtInFunction;
			BuiltInComponentGVO builtInComponentGVO = focus.getBuiltInComponentGVO();
			String component = builtInComponentGVO.getComponentIdUUID();
			List<UIObject> uiObjects = null;
			if (component != null) {
				uiObjects = getUIObjects(component, focus);
			} else {
				uiObjects = RendererHelper.getNamedComponent(builtInComponentGVO.getComponentName());
			}

			if (uiObjects != null) {
				for (UIObject uiObject : uiObjects) {
					if (uiObject instanceof Widget) {
						Widget w = (Widget) uiObject;
						makeParentsVisible(w);
//						TO BE REMOVED						
//						if (w.getParent() != null) {
//							Widget parent = w.getParent();
//							makeParentsVisible(parent);
//						}
					}
					if (uiObject instanceof Focusable) {
						((Focusable) uiObject).setFocus(true);
					}
				}
			}
		}

		FunctionsExecutor.setProcessedBuiltIn(true);

	}
 
开发者ID:qafedev,项目名称:qafe-platform,代码行数:34,代码来源:FocusExecute.java

示例15: getTabIndex

import com.google.gwt.user.client.ui.Focusable; //导入依赖的package包/类
@Override
public final int getTabIndex() {
  if (this.contents.getWidget() instanceof Focusable) {
    return ((Focusable) this.contents.getWidget()).getTabIndex();
  }
  return 0;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:8,代码来源:AbstractDecorator.java


注:本文中的com.google.gwt.user.client.ui.Focusable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。