本文整理了Java中org.netbeans.api.visual.widget.Widget.getParentWidget()
方法的一些代码示例,展示了Widget.getParentWidget()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getParentWidget()
方法的具体详情如下:
包路径:org.netbeans.api.visual.widget.Widget
类名称:Widget
方法名:getParentWidget
[英]Returns a parent widget.
[中]返回父窗口小部件。
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
/**
* Returns an object which is assigned to a widget.
* If the widget is not mapped to any object then the method recursively searches for an object of the parent widget.
* @param widget the widget
* @return the mapped object; null if no object is assigned to a widget or any of its parent widgets
*/
public final Object findObject (Widget widget) {
while (widget != null) {
Object o = widget2object.get (widget);
if (o != null)
return o;
widget = widget.getParentWidget ();
}
return null;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
/**
* Returns an object which is assigned to a widget.
* If the widget is not mapped to any object then the method recursively searches for an object of the parent widget.
* @param widget the widget
* @return the mapped object; null if no object is assigned to a widget or any of its parent widgets
*/
public final Object findObject (Widget widget) {
while (widget != null) {
Object o = widget2object.get (widget);
if (o != null)
return o;
widget = widget.getParentWidget ();
}
return null;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
/**
* Retreives the widgets resource table. If the widgets resource table is
* not set then the widgets parent resource table it retrieved.
*
* @return The resource table.
*/
public ResourceTable getResourceTable() {
ResourceTable retVal = resourceTable;
if ((retVal == null) && (getParentWidget() != null)) {
retVal = getParentWidget().getResourceTable();
}
return retVal;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
/**
* Retreives the widgets resource table. If the widgets resource table is
* not set then the widgets parent resource table it retrieved.
*
* @return The resource table.
*/
public ResourceTable getResourceTable() {
ResourceTable retVal = resourceTable;
if ((retVal == null) && (getParentWidget() != null)) {
retVal = getParentWidget().getResourceTable();
}
return retVal;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
void dispatchNotifyAdded (Widget widget) {
assert widget != null;
Widget w = widget;
for (; ;) {
if (w == this)
break;
w = w.getParentWidget ();
if (w == null)
return;
}
if (! viewShowing)
return;
widget.dispatchNotifyAddedCore ();
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
void dispatchNotifyAdded (Widget widget) {
assert widget != null;
Widget w = widget;
for (; ;) {
if (w == this)
break;
w = w.getParentWidget ();
if (w == null)
return;
}
if (! viewShowing)
return;
widget.dispatchNotifyAddedCore ();
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private ResourceTable connectResourceTable() {
if ((resourceTable != null) && (getParentWidget() != null)) {
ResourceTable parentTable = getParentWidget().getResourceTable();
resourceTable.setParentTable(parentTable);
}
return getResourceTable();
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private ResourceTable connectResourceTable() {
if ((resourceTable != null) && (getParentWidget() != null)) {
ResourceTable parentTable = getParentWidget().getResourceTable();
resourceTable.setParentTable(parentTable);
}
return getResourceTable();
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private Widget resolveTopMostDisabledWidget (Widget widget) {
Widget disabledWidget = null;
Widget tempWidget = widget;
while (tempWidget != null) {
if (! tempWidget.isVisible () || ! tempWidget.isEnabled ())
disabledWidget = tempWidget;
tempWidget = tempWidget.getParentWidget ();
}
return disabledWidget;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public int getAccessibleIndexInParent () {
return widget != widget.getScene () ? widget.getParentWidget ().getChildren ().indexOf (widget) : 0;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public int getAccessibleIndexInParent () {
return widget != widget.getScene () ? widget.getParentWidget ().getChildren ().indexOf (widget) : 0;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private Widget resolveTopMostDisabledWidget (Widget widget) {
Widget disabledWidget = null;
Widget tempWidget = widget;
while (tempWidget != null) {
if (! tempWidget.isVisible () || ! tempWidget.isEnabled ())
disabledWidget = tempWidget;
tempWidget = tempWidget.getParentWidget ();
}
return disabledWidget;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private void resolveContext (Widget widget, MouseContext context) {
if (widget == null)
return;
context.update (widget, null);
resolveContext (widget.getParentWidget (), context);
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
private void resolveContext (Widget widget, MouseContext context) {
if (widget == null)
return;
context.update (widget, null);
resolveContext (widget.getParentWidget (), context);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation
public String getText(Widget widget) {
NavigationCaseEdge caseNode = (NavigationCaseEdge) findObject(widget.getParentWidget());
return ((LabelWidget) widget).getLabel();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation
public boolean isEnabled(Widget widget) {
NavigationCaseEdge caseNode = (NavigationCaseEdge) findObject(widget.getParentWidget());
return caseNode.isModifiable();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation
public void setText(Widget widget, String newName) {
if (newName.equals("")) {
return;
}
NavigationCaseEdge caseNode = (NavigationCaseEdge) findObject(widget.getParentWidget());
String oldName = caseNode.getName();
if (caseNode.canRename()) {
//Pin pin = getEdgeSource(caseNode);
//caseNode.setName(pin, newName);
caseNode.setName(newName);
}
((LabelWidget) widget).setLabel(newName);
}
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
public State mouseReleased (Widget widget, WidgetMouseEvent event) {
if (selectionSceneRectangle != null) {
move (widget, event.getPoint ());
selectionWidget.getParentWidget ().removeChild (selectionWidget);
provider.performSelection (selectionSceneRectangle);
selectionWidget = null;
selectionSceneRectangle = null;
}
return State.REJECTED;
}
代码示例来源:origin: in.jlibs/org-netbeans-api-visual
public State mouseReleased (Widget widget, WidgetMouseEvent event) {
if (selectionSceneRectangle != null) {
move (widget, event.getPoint ());
selectionWidget.getParentWidget ().removeChild (selectionWidget);
provider.performSelection (selectionSceneRectangle);
selectionWidget = null;
selectionSceneRectangle = null;
}
return State.REJECTED;
}
代码示例来源:origin: org.netbeans.api/org-netbeans-api-visual
private WidgetAction.State processParentOperator (Operator operator, String tool, Widget widget, WidgetAction.WidgetKeyEvent event) {
while (widget != null) {
WidgetAction.State state;
state = operator.operate (widget.getActions (), widget, event);
if (state.isConsumed ())
return state;
WidgetAction.Chain actions = widget.getActions (tool);
if (actions != null) {
state = operator.operate (actions, widget, event);
if (state.isConsumed ())
return state;
}
widget = widget.getParentWidget ();
}
return WidgetAction.State.REJECTED;
}
内容来源于网络,如有侵权,请联系作者删除!