Creates and returns a new push button with the given label and/or image.

@param parent
parent control
@param label
button label or <code>null</code>
@param image
image of <code>null</code>
@return a new push button
427211
public static Button createPushButton(Composite parent, String label,
			Image image)
	{
		Button button = new Button(parent, SWT.PUSH);
		button.setFont(parent.getFont());
		if (image != null)
		{
			button.setImage(image);
		}
		if (label != null)
		{
			button.setText(label);
		}
		GridData gd = new GridData();
		button.setLayoutData(gd);

		return button;
	}
1171263
protected PushButton createAddButton() {

        PushButton button = createIconButton(I_CmsButton.ADD_SMALL);
        button.setTitle(aliasMessages.addAlias());
        return button;
    }
1316748
public void adoptParent(ElementBox parent)
    {
        if (parent instanceof BlockBox)
            setContainingBlockBox(parent);
        else
            setContainingBlockBox(parent.getContainingBlockBox());
        setParent(parent);
        setViewport(parent.getViewport());
        setClipBlock(parent.getClipBlock());
    }
727455
public void setLabels(FileChooserLabels labels) {
		this.labels = labels;
		
		// Verify if the buttons for add a file or select a folder has been modified.
		if(labels != null) {
			LinearLayout root = this.chooser.getRootLayout();
			
			if(labels.labelAddButton != null) {
				Button addButton = (Button) root.findViewById(R.id.buttonAdd);
				addButton.setText(labels.labelAddButton);
			}
			
			if(labels.labelSelectButton != null) {
				Button okButton = (Button) root.findViewById(R.id.buttonOk);
				okButton.setText(labels.labelSelectButton);
			}			
		}
	}
376471
public void pushLoop(String labelName) {
        pushState();
        continueLabel = new Label();
        breakLabel = new Label();
        initLoopLabels(labelName);
    }
603191
protected Button createRadioButton(Composite parent, String text)
	{
		return SWTFactory.createRadioButton(parent, text);
	}
43363
def on_parent(self, *args):
        """"""
        if not self.parent or hasattr(self, '_parented'):
            return
        if not self.wallpaper_path:
            Logger.debug("Board: waiting for wallpaper_path")
            Clock.schedule_once(self.on_parent, 0)
            return
        self._parented = True
        self.wallpaper = Image(source=self.wallpaper_path)
        self.bind(wallpaper_path=self._pull_image)
        self._pull_size()
        self.kvlayoutback = KvLayoutBack(**self.widkwargs)
        self.arrowlayout = ArrowLayout(**self.widkwargs)
        self.spotlayout = FinalLayout(**self.widkwargs)
        self.kvlayoutfront = KvLayoutFront(**self.widkwargs)
        for wid in self.wids:
            self.add_widget(wid)
            wid.pos = 0, 0
            wid.size = self.size
            if wid is not self.wallpaper:
                self.bind(size=wid.setter('size'))
        self.update()
936394
public Element createDOMNode(Element parent) {
        Element domNode = parent.getOwnerDocument().createElement(tagName);
        LayoutUtil.copyAttributes(attributes, domNode);
        parent.appendChild(domNode);
        return domNode;
    }
660293
@Override
    public void visitLabel(Label label) {
        super.visitLabel(label);

        if (waitingForSuper) {
            // Get what should be the shape of the stack in the handler.
            // Not all labels are branch targets so only deal with targets
            if (branchTargets.containsKey(label)) {
                currentStack = branchTargets.get(label);
            }
        } else {
            pendingExceptionHandlerTypeName = handlers.get(label);
        }
    }
388425
public void init(Object parent, Object record)
    {
    	super.init(parent, record);
    	
        this.setOpaque(false);
        this.setBorder(new EtchedBorder());
        
        this.setLayout(new BorderLayout());
        this.add(m_helpView = new JHelpView(this, null), BorderLayout.CENTER);
        this.add(m_iconArea = new JBaseToolbar(this, null)
	        {
	            private static final long serialVersionUID = 1L;
	            /**
	             * Add the buttons to this window.
	             * Override this to include buttons other than the default buttons.
	             */
	            public void addButtons()
	            {
	               //super.addButtons();
	               //addButton(ThinMenuConstants.HOME);
	               JButton button = addButton(null, ThinMenuConstants.CLOSE, ThinMenuConstants.CLOSE);
	               button.setOpaque(false);
	               button.setBorder(new LineBorder(Color.black, 1));
	             }
	        }, BorderLayout.NORTH);
        m_iconArea.setOpaque(false);
        
        m_helpView.getHtmlEditor().setHelpPane(this);
    }
849832
public void setLabel (String label)
    {
        _label.setText(label);
        _label.setVisible(!StringUtil.isBlank(label));
    }
903866
public void setImage(final Image image) {
		ButtonModel model = getOrCreateComponentModel();
		model.image = image;
		model.imageUrl = null;
	}
880941
public void setImage(final Image image) {
		LinkModel model = getOrCreateComponentModel();
		model.image = image;
		model.imageUrl = null;
	}
198766
@Override
	public void layoutContainer(Container parent) {
		synchronized (parent.getTreeLock()) {
			Insets insets=parent.getInsets();
			int ncomponents=parent.getComponentCount();
			if(ncomponents==0) return;

			int nrows=rows;
			int ncols=columns;
			if(nrows>0) {
				ncols=((ncomponents/2)+nrows-1)/nrows;
			} else {
				nrows=((ncomponents/2)+ncols-1)/ncols;
			}

			// Determine the desired widths for the labels
			int[] labelWidths=new int[ncols];
			int pos=0;
		Loop1:
			for(int y=0;y<nrows;y++) {
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop1;
					Component component=parent.getComponent(pos);
					pos+=2;
					Dimension d=component.getPreferredSize();
					if(d.width>labelWidths[x]) labelWidths[x]=d.width;
				}
			}
			Dimension parentSize=parent.getSize();
			int width=parentSize.width-(insets.left+insets.right);
			int height=parentSize.height-(insets.top+insets.bottom);
			int lasty=0;
			pos=0;
		Loop:
			for(int y=0;y<nrows;y++) {
				int yend=0;
				int cellHeight=0;
				if (stretchComponents) {
					yend=((y+1)*(height+vgap))/nrows-vgap;
					cellHeight=yend-lasty;
				}
				int lastx=0;
				for(int x=0;x<ncols;x++) {
					if(pos>=ncomponents) break Loop;
					int xend=((x+1)*(width+hgap))/ncols-hgap;
					int cellWidth=xend-lastx;
					// Split this width into two areas, left for label and right for component
					int availableWidth=labelWidths[x];
					if(availableWidth>cellWidth) availableWidth=cellWidth;
					// Reshape the label to fit
					Component label=parent.getComponent(pos++);
					Dimension labelD=label.getPreferredSize();
					Component component=parent.getComponent(pos++);
					Dimension componentD=component.getPreferredSize();
					if (!stretchComponents) {
						cellHeight = Math.max(labelD.height, componentD.height);
						if((lasty+cellHeight)>yend) yend=lasty+cellHeight;
						// yend = lasty+cellHeight;
					}

					//int actualWidth=labelD.width;
					//if(actualWidth>availableWidth) actualWidth=availableWidth;
					label.setBounds(
						lastx+insets.left,
						lasty+insets.top,
						availableWidth,
						cellHeight
					);
					// Split out the right area
					if(pos>ncomponents) break Loop;
					availableWidth=cellWidth-cgap-labelWidths[x];
					if(availableWidth<0) availableWidth=0;
					// Reshape the component
					int actualWidth=componentD.width;
					if(actualWidth>availableWidth) actualWidth=availableWidth;
					component.setBounds(
						lastx+labelWidths[x]+cgap+insets.left,
						lasty+insets.top,
						actualWidth,
						cellHeight /*Klay--8/22/01*/
					);
					// Get ready for next iteration
					lastx=xend+hgap;
				}
				lasty=yend+vgap;
			}
		}
	}
1185497
function parentHasAriaLabel(element, level) {
    level = level || 1;
    var node = angular.element(element)[0] || element;
    if (!node.parentNode) {
      return false;
    }
    if (performCheck(node.parentNode)) {
      return true;
    }
    level--;
    if (level) {
      return parentHasAriaLabel(node.parentNode, level);
    }
    return false;

    function performCheck(parentNode) {
      if (!hasAriaLabel(parentNode)) {
        return false;
      }
      /* Perform role blacklist check */
      if (parentNode.hasAttribute('role')) {
        switch (parentNode.getAttribute('role').toLowerCase()) {
          case 'command':
          case 'definition':
          case 'directory':
          case 'grid':
          case 'list':
          case 'listitem':
          case 'log':
          case 'marquee':
          case 'menu':
          case 'menubar':
          case 'note':
          case 'presentation':
          case 'separator':
          case 'scrollbar':
          case 'status':
          case 'tablist':
            return false;
        }
      }
      /* Perform tagName blacklist check */
      switch (parentNode.tagName.toLowerCase()) {
        case 'abbr':
        case 'acronym':
        case 'address':
        case 'applet':
        case 'audio':
        case 'b':
        case 'bdi':
        case 'bdo':
        case 'big':
        case 'blockquote':
        case 'br':
        case 'canvas':
        case 'caption':
        case 'center':
        case 'cite':
        case 'code':
        case 'col':
        case 'data':
        case 'dd':
        case 'del':
        case 'dfn':
        case 'dir':
        case 'div':
        case 'dl':
        case 'em':
        case 'embed':
        case 'fieldset':
        case 'figcaption':
        case 'font':
        case 'h1':
        case 'h2':
        case 'h3':
        case 'h4':
        case 'h5':
        case 'h6':
        case 'hgroup':
        case 'html':
        case 'i':
        case 'ins':
        case 'isindex':
        case 'kbd':
        case 'keygen':
        case 'label':
        case 'legend':
        case 'li':
        case 'map':
        case 'mark':
        case 'menu':
        case 'object':
        case 'ol':
        case 'output':
        case 'pre':
        case 'presentation':
        case 'q':
        case 'rt':
        case 'ruby':
        case 'samp':
        case 'small':
        case 'source':
        case 'span':
        case 'status':
        case 'strike':
        case 'strong':
        case 'sub':
        case 'sup':
        case 'svg':
        case 'tbody':
        case 'td':
        case 'th':
        case 'thead':
        case 'time':
        case 'tr':
        case 'track':
        case 'tt':
        case 'ul':
        case 'var':
          return false;
      }
      return true;
    }
  }
941069
function ( Class, Label, Container ) {
			var Button = L.DomUtil.create( 'button', Class, Container );
			Button.setAttribute( 'type' , 'button' );
			Button.innerHTML = Label;
			
			return Button;
		}
549191
public void addScreenLabels(Container parent)
    {
        GridBagConstraints c = this.getGBConstraints();
        c.weightx = 0.0;                        // Minimum width to hold labels
        c.anchor = GridBagConstraints.NORTHEAST;    // Labels right justified
        c.gridx = 0;                            // Column 0
        c.gridy = GridBagConstraints.RELATIVE;  // Bump Row each time
        for (int iIndex = 0; ; iIndex++)
        {
            Converter converter = this.getFieldForScreen(iIndex);
            if (converter == SKIP_THIS_FIELD)
                continue;
            if (converter == null)
                break;
            this.addScreenLabel(parent, converter);
        }
    }