本文整理了Java中org.eclipse.swt.widgets.Group.getChildren()
方法的一些代码示例,展示了Group.getChildren()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.getChildren()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Group
类名称:Group
方法名:getChildren
暂无
代码示例来源:origin: pentaho/pentaho-kettle
public int selectedIndex() {
Control[] children = radioGroup.getChildren();
for ( int i = 0; i < children.length; i++ ) {
Control child = children[ i ];
Button button = (Button) child;
if ( button.getSelection() ) {
return i;
}
}
return -1;
}
代码示例来源:origin: pentaho/pentaho-kettle
public void setSelectedIndex( int index ) {
for ( Control control : radioGroup.getChildren() ) {
( (Button) control ).setSelection( false );
}
( (Button) radioGroup.getChildren()[ index ] ).setSelection( true );
radioGroup.getChildren()[index].notifyListeners( SWT.Selection, new Event() );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
private void clearOptions() {
for ( Control control : gOptions.getChildren() ) {
control.dispose();
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public Composite createContent( String radioText ) {
Control[] existingButtons = radioGroup.getChildren();
Button button = new Button( radioGroup, SWT.RADIO );
button.setText( radioText );
props.setLook( button );
FormData fdButton = new FormData();
fdButton.top = new FormAttachment( 0 );
fdButton.left = existingButtons.length == 0
? new FormAttachment( 0 ) : new FormAttachment( existingButtons[existingButtons.length - 1], 40 );
button.setLayoutData( fdButton );
button.setSelection( existingButtons.length == 0 );
Composite content = new Composite( contentArea, SWT.NONE );
content.setVisible( existingButtons.length == 0 );
props.setLook( content );
content.setLayout( noMarginLayout );
content.setLayoutData( fdMaximize );
button.addSelectionListener( new SelectionAdapter() {
@Override public void widgetSelected( SelectionEvent selectionEvent ) {
for ( Control control : contentArea.getChildren() ) {
control.setVisible( false );
}
content.setVisible( true );
}
} );
return content;
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.api.tools.ui
/**
* Sets the enabled state of all of the child of the given group
*
* @param group
* @param enabled
*/
void setGroupEnablement(Group group, boolean enabled) {
Control[] children = group.getChildren();
for (Control element : children) {
element.setEnabled(enabled);
}
}
代码示例来源:origin: org.eclipse.pde.api.tools/ui
/**
* Sets the enabled state of all of the child of the given group
* @param group
* @param enabled
*/
void setGroupEnablement(Group group, boolean enabled) {
Control[] children = group.getChildren();
for (int i = 0; i < children.length; i++) {
children[i].setEnabled(enabled);
}
}
代码示例来源:origin: net.sf.okapi.steps/okapi-step-segmentation-ui
private void updateOptionsDisplay () {
boolean enabled = chkSegmentTarget.getSelection() || chkSegmentSource.getSelection();
grpOptions.setEnabled(enabled);
for ( Control ctrl : grpOptions.getChildren() ) {
ctrl.setEnabled(enabled);
}
}
代码示例来源:origin: org.xworker/xworker_swt
@Override
public Control remove(Group parent, Control control) {
Thing parentThing = Designer.getThing(parent);
Thing itemThing = Designer.getThing(control);
parentThing.removeChild(itemThing);
parentThing.save();
int index = -1;
for(int i=0; i<parent.getChildren().length; i++){
index++;
if(parent.getChildren()[i] == control){
break;
}
}
control.dispose();
SwtUtils.layout(parent);
if(index != -1){
if(parent.getChildren().length > index){
return parent.getChildren()[index];
}else if(parent.getChildren().length > index - 1 && index != 0){
return parent.getChildren()[index - 1];
}else{
return parent;
}
}else{
return parent;
}
}
代码示例来源:origin: org.xworker/xworker_swt
public ItemInfo getItemIndex(Group parent, Control control){
int index = -1;
for(Control item : parent.getChildren()){
index++;
if(item == control){
return new ItemInfo(index, Designer.getThing(item));
}
}
return null;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
/**
* Set whether or not the controls in the field editor are enabled.
*
* @param enabled
* The enabled state.
*/
public void setEnabled(boolean enabled) {
group.setEnabled(enabled);
Control[] children = group.getChildren();
for (int i = 0; i < children.length; i++) {
children[i].setEnabled(enabled);
}
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent (Event event) {
Control [] children = gRadio.getChildren ();
for (int j=0; j<children.length; j++) {
Control child = children [j];
if (child instanceof Button) {
Button button = (Button) child;
if ((button.getStyle () & SWT.RADIO) != 0) button.setSelection (false);
}
}
Button button = (Button) event.widget;
button.setSelection (true);
int mode = Integer.parseInt((String)button.getData("iMode"));
selected_button[0] = button;
setModeText.run();
//linkLabel.setText( MessageText.getString(messTexts[mode]) );
linkLabel.setData( links[mode] );
/*
if(mode == 1){
linkLabel1.setText( MessageText.getString(messTexts[3]) );
linkLabel1.setData( links[3] );
} else{
linkLabel1.setText( "" );
linkLabel1.setData( "" );
}
*/
COConfigurationManager.setParameter("User Mode", Integer.parseInt((String)button.getData("iMode")));
}
};
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent (Event event) {
Control [] children = gRadio.getChildren ();
for (int j=0; j<children.length; j++) {
Control child = children [j];
if (child instanceof Button) {
Button button = (Button) child;
if ((button.getStyle () & SWT.RADIO) != 0) button.setSelection (false);
}
}
Button button = (Button) event.widget;
button.setSelection (true);
int mode = Integer.parseInt((String)button.getData("iMode"));
text[0] = MessageText.getString("ConfigView.section.mode." + (String)button.getData("sMode"));
labl.setText(text[0]);
linkLabel.setText( MessageText.getString(messTexts[mode]) );
linkLabel.setData( links[mode] );
if(mode == 1){
linkLabel1.setText( MessageText.getString(messTexts[3]) );
linkLabel1.setData( links[3] );
} else{
linkLabel1.setText( "" );
linkLabel1.setData( "" );
}
COConfigurationManager.setParameter("User Mode", Integer.parseInt((String)button.getData("iMode")));
}
};
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void fillLimitToGroup(int searchFor, int limitTo) {
Control[] children= fLimitToGroup.getChildren();
for (int i= 0; i < children.length; i++) {
children[i].dispose();
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void fillLimitToGroup(int searchFor, int limitTo) {
Control[] children= fLimitToGroup.getChildren();
for (int i= 0; i < children.length; i++) {
children[i].dispose();
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private Button createMethodLocationRadio(boolean isSelected) {
if (fLimitToGroup.getChildren().length % 2 != 0)
new Label(fLimitToGroup, SWT.NONE);
Button button= createButton(fLimitToGroup, SWT.RADIO, SearchMessages.JavaSearchPage_match_locations_label, SPECIFIC_REFERENCES, isSelected);
fMatchLocationsLink= new Link(fLimitToGroup, SWT.NONE);
fMatchLocationsLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fMatchLocationsLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
performConfigureMatchLocation();
}
@Override
public void widgetSelected(SelectionEvent e) {
performConfigureMatchLocation();
}
});
fMatchLocationsLink.getAccessible().addAccessibleListener(new AccessibleAdapter() {
/*
* @see org.eclipse.swt.accessibility.AccessibleAdapter#getName(org.eclipse.swt.accessibility.AccessibleEvent)
* @since 3.8
*/
@Override
public void getName(AccessibleEvent e) {
if (e.childID == ACC.CHILDID_SELF)
e.result= SearchMessages.JavaSearchPage_match_location_link_label_tooltip;
}
});
updateMatchLocationText();
return button;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private Button createMethodLocationRadio(boolean isSelected) {
if (fLimitToGroup.getChildren().length % 2 != 0)
new Label(fLimitToGroup, SWT.NONE);
Button button= createButton(fLimitToGroup, SWT.RADIO, SearchMessages.JavaSearchPage_match_locations_label, SPECIFIC_REFERENCES, isSelected);
fMatchLocationsLink= new Link(fLimitToGroup, SWT.NONE);
fMatchLocationsLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
fMatchLocationsLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
performConfigureMatchLocation();
}
@Override
public void widgetSelected(SelectionEvent e) {
performConfigureMatchLocation();
}
});
fMatchLocationsLink.getAccessible().addAccessibleListener(new AccessibleAdapter() {
/*
* @see org.eclipse.swt.accessibility.AccessibleAdapter#getName(org.eclipse.swt.accessibility.AccessibleEvent)
* @since 3.8
*/
@Override
public void getName(AccessibleEvent e) {
if (e.childID == ACC.CHILDID_SELF)
e.result= SearchMessages.JavaSearchPage_match_location_link_label_tooltip;
}
});
updateMatchLocationText();
return button;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
Control [] children = styleGroup.getChildren ();
for (Control child : children) {
if (child instanceof Button) {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
Control[] otherChildren= group.getChildren();
if (fProject != null) {
String label= PreferencesMessages.ComplianceConfigurationBlock_compliance_follows_EE_label;
Control[] allChildren= group.getChildren();
fComplianceFollowsEEControls.addAll(Arrays.asList(allChildren));
fComplianceFollowsEEControls.removeAll(Arrays.asList(otherChildren));
addCheckBox(group, label, INTR_DEFAULT_COMPLIANCE, defaultUserValues, 0);
allChildren= group.getChildren();
fComplianceControls.addAll(Arrays.asList(allChildren));
fComplianceControls.removeAll(Arrays.asList(otherChildren));
addComboBox(group, label, PREF_PB_ENUM_AS_IDENTIFIER, errorWarningInfoIgnore, errorWarningInfoIgnoreLabels, indent);
allChildren= group.getChildren();
fComplianceChildControls.addAll(Arrays.asList(allChildren));
fComplianceChildControls.removeAll(Arrays.asList(otherChildren));
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
Control[] otherChildren= group.getChildren();
Control[] allChildren= group.getChildren();
fComplianceControls.addAll(Arrays.asList(allChildren));
fComplianceControls.removeAll(Arrays.asList(otherChildren));
代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui
private void toggleAttributesWidgets(boolean isValue) {
if (!isValue) {
// recreate the attribute list
fValueTmp= fSnippetDocument.get();
createAttributeListWidgets();
} else if (isValue) {
// dispose the attribute list
saveAttributeValue();
Control[] children= fAttributesContainer.getChildren();
for (int i= 0; i < children.length; i++) {
children[i].dispose();
}
}
// dispose and recreate the code snippet editor group
Control[] children= fCodeGroup.getChildren();
for (int i = 0; i < children.length; i++) {
children[i].dispose();
}
fSnippetViewer.dispose();
createCodeGroupWidgets(isValue);
setAttributesData(isValue);
fParentComposite.layout(true, true);
}
内容来源于网络,如有侵权,请联系作者删除!