本文整理匯總了Java中com.intellij.uiDesigner.radComponents.RadButtonGroup類的典型用法代碼示例。如果您正苦於以下問題:Java RadButtonGroup類的具體用法?Java RadButtonGroup怎麽用?Java RadButtonGroup使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
RadButtonGroup類屬於com.intellij.uiDesigner.radComponents包,在下文中一共展示了RadButtonGroup類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: groupButtons
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public static void groupButtons(final GuiEditor editor, final List<RadComponent> selectedComponents) {
if (!editor.ensureEditable()) return;
String groupName = Messages.showInputDialog(editor.getProject(),
UIDesignerBundle.message("group.buttons.name.prompt"),
UIDesignerBundle.message("group.buttons.title"),
Messages.getQuestionIcon(),
editor.getRootContainer().suggestGroupName(),
new IdentifierValidator(editor.getProject()));
if (groupName == null) return;
RadRootContainer rootContainer = editor.getRootContainer();
RadButtonGroup group = rootContainer.createGroup(groupName);
for(RadComponent component: selectedComponents) {
rootContainer.setGroupForComponent(component, group);
}
editor.refreshAndSave(true);
}
示例2: MyPropertyEditor
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public MyPropertyEditor() {
myCbx.setRenderer(new ListCellRendererWrapper<RadButtonGroup>() {
@Override
public void customize(JList list, RadButtonGroup value, int index, boolean selected, boolean hasFocus) {
if (value == null) {
setText(UIDesignerBundle.message("button.group.none"));
}
else if (value == RadButtonGroup.NEW_GROUP) {
setText(UIDesignerBundle.message("button.group.new"));
}
else {
setText(value.getName());
}
}
});
myCbx.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED && e.getItem() == RadButtonGroup.NEW_GROUP) {
String newGroupName = myRootContainer.suggestGroupName();
newGroupName = (String)JOptionPane.showInputDialog(myCbx,
UIDesignerBundle.message("button.group.name.prompt"),
UIDesignerBundle.message("button.group.name.title"),
JOptionPane.QUESTION_MESSAGE, null, null, newGroupName);
if (newGroupName != null) {
RadButtonGroup group = myRootContainer.createGroup(newGroupName);
myRootContainer.setGroupForComponent(myComponent, group);
updateModel();
}
}
}
});
}
示例3: updateModel
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
private void updateModel() {
RadButtonGroup[] groups = myRootContainer.getButtonGroups();
RadButtonGroup[] allGroups = new RadButtonGroup[groups.length+2];
System.arraycopy(groups, 0, allGroups, 1, groups.length);
allGroups [allGroups.length-1] = RadButtonGroup.NEW_GROUP;
myCbx.setModel(new DefaultComboBoxModel(allGroups));
myCbx.setSelectedItem(FormEditingUtil.findGroupForComponent(myRootContainer, myComponent));
}
示例4: run
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public void run() {
RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(myComponent);
if (root == null) return;
for(RadButtonGroup group: root.getButtonGroups()) {
if (group.getName().equals(myGroupName)) {
root.setGroupForComponent(myComponent, group);
break;
}
}
myEditor.refreshAndSave(true);
}
示例5: getParentElement
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public Object getParentElement(final Object element){
if (element instanceof ComponentTreeStructureRoot) {
return null;
}
else if (element instanceof LwInspectionSuppression[] || element instanceof RadButtonGroup[]) {
return myRootElement;
}
else if (element instanceof LwInspectionSuppression) {
return myEditor.getRootContainer().getInspectionSuppressions();
}
else if (element instanceof RadButtonGroup) {
return myEditor.getRootContainer().getButtonGroups();
}
else if (element instanceof ComponentPtr) { // RadContainer is also RadComponent
final ComponentPtr ptr = (ComponentPtr)element;
if (!ptr.isValid()) return myRootElement;
final RadComponent component = ptr.getComponent();
if (component instanceof RadRootContainer) {
return myRootElement;
}
else {
return component.getParent() != null ? new ComponentPtr(myEditor, component.getParent(), false) : null;
}
}
else {
throw new IllegalArgumentException("unknown element: " + element);
}
}
示例6: createDescriptor
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
@NotNull
public NodeDescriptor createDescriptor(final Object element,final NodeDescriptor parentDescriptor){
if(element==myRootElement){
return new RootDescriptor(parentDescriptor,myRootElement);
}
else if(element instanceof ComponentPtr){
return new ComponentPtrDescriptor(parentDescriptor,(ComponentPtr)element);
}
else if (element instanceof LwInspectionSuppression[]) {
return new SuppressionGroupDescriptor(parentDescriptor, (LwInspectionSuppression[]) element);
}
else if (element instanceof LwInspectionSuppression) {
final LwInspectionSuppression suppression = (LwInspectionSuppression)element;
RadComponent target = (RadComponent)(suppression.getComponentId() == null
? null
: FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()));
return new SuppressionDescriptor(parentDescriptor, target, suppression);
}
else if (element instanceof RadButtonGroup[]) {
return new ButtonGroupListDescriptor(parentDescriptor, (RadButtonGroup[]) element);
}
else if (element instanceof RadButtonGroup) {
return new ButtonGroupDescriptor(parentDescriptor, (RadButtonGroup) element);
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}
示例7: customize
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
@Override protected void customize(@NotNull final RadButtonGroup value) {
setText(value.getName());
}
示例8: getValue
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public RadButtonGroup getValue(RadComponent component) {
final RadRootContainer rootContainer = (RadRootContainer) FormEditingUtil.getRoot(component);
return rootContainer == null ? null : (RadButtonGroup) FormEditingUtil.findGroupForComponent(rootContainer, component);
}
示例9: setValueImpl
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
protected void setValueImpl(RadComponent component, RadButtonGroup value) throws Exception {
final RadRootContainer radRootContainer = (RadRootContainer) FormEditingUtil.getRoot(component);
assert radRootContainer != null;
radRootContainer.setGroupForComponent(component, value);
}
示例10: getRenderer
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
@NotNull public PropertyRenderer<RadButtonGroup> getRenderer() {
return myRenderer;
}
示例11: getEditor
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public PropertyEditor<RadButtonGroup> getEditor() {
return myEditor;
}
示例12: getComponent
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public JComponent getComponent(RadComponent component, RadButtonGroup value, InplaceContext inplaceContext) {
myComponent = component;
myRootContainer = (RadRootContainer) FormEditingUtil.getRoot(myComponent);
updateModel();
return myCbx;
}
示例13: getChildElements
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public Object[] getChildElements(final Object element){
if(element==myRootElement){
ArrayList<Object> elements = new ArrayList<Object>();
final RadRootContainer rootContainer=myEditor.getRootContainer();
elements.add(new ComponentPtr(myEditor, rootContainer));
final LwInspectionSuppression[] suppressions = rootContainer.getInspectionSuppressions();
if (suppressions.length > 0) {
elements.add(suppressions);
}
RadButtonGroup[] buttonGroups = rootContainer.getButtonGroups();
if (buttonGroups.length > 0) {
elements.add(buttonGroups);
}
return elements.toArray();
}
else if(element instanceof ComponentPtr){
final ComponentPtr ptr=(ComponentPtr)element;
LOG.assertTrue(ptr.isValid()); // pointer must be valid
final RadComponent component=ptr.getComponent();
if(component instanceof RadContainer){
final RadContainer container=(RadContainer)component;
final ComponentPtr[] ptrs=new ComponentPtr[container.getComponentCount()];
for(int i=0;i<ptrs.length;i++){
ptrs[i]=new ComponentPtr(myEditor,container.getComponent(i));
}
return ptrs;
}else{
return ourEmptyObjectArray;
}
}
else if (element instanceof LwInspectionSuppression[]) {
ArrayList<LwInspectionSuppression> result = new ArrayList<LwInspectionSuppression>();
for(LwInspectionSuppression suppression: (LwInspectionSuppression[]) element) {
if (suppression.getComponentId() == null ||
FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()) != null) {
result.add(suppression);
}
}
return ArrayUtil.toObjectArray(result);
}
else if (element instanceof RadButtonGroup[]) {
return (RadButtonGroup[]) element;
}
else if (element instanceof LwInspectionSuppression || element instanceof RadButtonGroup) {
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
else{
throw new IllegalArgumentException("unknown element: "+element);
}
}
示例14: ButtonGroupListDescriptor
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public ButtonGroupListDescriptor(final NodeDescriptor parentDescriptor, final RadButtonGroup[] buttonGroups) {
super(null, parentDescriptor);
myButtonGroups = buttonGroups;
}
示例15: ButtonGroupDescriptor
import com.intellij.uiDesigner.radComponents.RadButtonGroup; //導入依賴的package包/類
public ButtonGroupDescriptor(final NodeDescriptor parentDescriptor, final RadButtonGroup group) {
super(null, parentDescriptor);
myGroup = group;
}