Setup the toolbar.
504842
def setup_toolbar(self):
        """"""
        self.savefig_btn = create_toolbutton(
            self, icon=ima.icon('filesave'),
            tip=_("Save Image As..."),
            triggered=self.emit_save_figure)
        self.delfig_btn = create_toolbutton(
            self, icon=ima.icon('editclear'),
            tip=_("Delete image"),
            triggered=self.emit_remove_figure)

        toolbar = QVBoxLayout()
        toolbar.setContentsMargins(0, 0, 0, 0)
        toolbar.setSpacing(1)
        toolbar.addWidget(self.savefig_btn)
        toolbar.addWidget(self.delfig_btn)
        toolbar.addStretch(2)

        return toolbar
1108917
private void initToolbar() {

        m_toolbar = new CmsToolbar();
        m_toolbar.setAppTitle(Messages.get().key(Messages.GUI_CONTENT_EDITOR_TITLE_0));
        m_publishButton = createButton(
            I_CmsButton.ButtonData.PUBLISH_BUTTON.getTitle(),
            I_CmsButton.ButtonData.PUBLISH_BUTTON.getIconClass());
        m_toolbar.addLeft(m_publishButton);
        m_publishButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                boolean unlock = shouldUnlockAutomatically();

                saveAndDeleteEntities(unlock, new I_CmsSimpleCallback<Boolean>() {

                    public void execute(final Boolean hasChangedSeetings) {

                        setSaved();
                        HashMap<String, String> params = new HashMap<String, String>(
                            getContext().getPublishParameters());
                        CmsUUID structureId = CmsContentDefinition.entityIdToUuid(getEntityId());
                        params.put(CmsPublishOptions.PARAM_CONTENT, "" + structureId);
                        params.put(CmsPublishOptions.PARAM_START_WITH_CURRENT_PAGE, "");
                        CmsPublishDialog.showPublishDialog(params, new CloseHandler<PopupPanel>() {

                            public void onClose(CloseEvent<PopupPanel> closeEvent) {

                                if (m_onClose != null) {
                                    m_onClose.execute(
                                        Boolean.valueOf(m_hasChangedSettings || hasChangedSeetings.booleanValue()));
                                }
                                clearEditor();
                            }
                        }, new Runnable() {

                            public void run() {

                                // ignore
                            }

                        }, null);

                    }
                });

            }
        });
        m_saveExitButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_SAVE_AND_EXIT_0),
            "opencms-icon-save-exit");
        m_saveExitButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                deferSaveAndExit();
            }
        });
        m_toolbar.addLeft(m_saveExitButton);
        m_saveButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_SAVE_0),
            I_CmsButton.ButtonData.SAVE_BUTTON.getIconClass());
        m_saveButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                deferSave();
            }
        });
        m_saveButton.setVisible(false);
        m_toolbar.addLeft(m_saveButton);
        disableSave(Messages.get().key(Messages.GUI_TOOLBAR_NOTHING_CHANGED_0));
        m_undoButton = createButton(Messages.get().key(Messages.GUI_TOOLBAR_UNDO_0), "opencms-icon-undo");
        m_undoButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                if (CmsUndoRedoHandler.getInstance().isIntitalized()) {
                    CmsUndoRedoHandler.getInstance().undo();
                }
            }
        });
        m_undoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_UNDO_DISABLED_0));
        m_undoButton.setVisible(false);
        m_toolbar.addLeft(m_undoButton);
        m_redoButton = createButton(Messages.get().key(Messages.GUI_TOOLBAR_REDO_0), "opencms-icon-redo");
        m_redoButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                if (CmsUndoRedoHandler.getInstance().isIntitalized()) {
                    CmsUndoRedoHandler.getInstance().redo();
                }
            }
        });
        m_redoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_REDO_DISABLED_0));
        m_redoButton.setVisible(false);
        m_toolbar.addLeft(m_redoButton);

        m_undoRedoHandlerRegistration = CmsUndoRedoHandler.getInstance().addValueChangeHandler(
            new ValueChangeHandler<CmsUndoRedoHandler.UndoRedoState>() {

                public void onValueChange(ValueChangeEvent<UndoRedoState> event) {

                    setUndoRedoState(event.getValue());
                }
            });
        m_openFormButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_OPEN_FORM_0),
            I_CmsButton.ButtonData.EDIT.getIconClass());
        m_openFormButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                initFormPanel();
                renderFormContent();
            }
        });
        m_toolbar.addLeft(m_openFormButton);

        m_hideHelpBubblesButton = new CmsToggleButton();

        m_hideHelpBubblesButton.setImageClass(I_CmsButton.ButtonData.TOGGLE_HELP.getIconClass());
        m_hideHelpBubblesButton.setButtonStyle(ButtonStyle.FONT_ICON, null);
        m_hideHelpBubblesButton.setSize(Size.big);
        m_hideHelpBubblesButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                CmsToggleButton button = (CmsToggleButton)event.getSource();
                hideHelpBubbles(!button.isDown());
            }
        });
        m_hideHelpBubblesButton.setDown(CmsCoreProvider.get().isShowEditorHelp());
        CmsValueFocusHandler.getInstance().hideHelpBubbles(RootPanel.get(), !CmsCoreProvider.get().isShowEditorHelp());
        if (!CmsCoreProvider.get().isShowEditorHelp()) {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_HIDDEN_0));
        } else {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_SHOWN_0));
        }
        m_toolbar.addRight(m_hideHelpBubblesButton);

        m_cancelButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_RESET_0),
            I_CmsButton.ButtonData.RESET_BUTTON.getIconClass());
        m_cancelButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                confirmCancel();
            }
        });
        m_toolbar.addRight(m_cancelButton);
        RootPanel.get().add(m_toolbar);
    }
982883
private void setupWizard() {
		setupComponents();
		layoutComponents();

		setMinimumSize(defaultminimumSize);

		// Center on screen
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		int xPosition = (screenSize.width / 2) - (defaultminimumSize.width / 2);
		int yPosition = (screenSize.height / 2) - (defaultminimumSize.height / 2);
		setLocation(xPosition, yPosition);

		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	}
234764
function setup() {
    var tmp = get('skin');
    if (tmp && $.inArray(tmp, my_skins))
      change_skin(tmp);

    //Add the change skin listener
    $("[data-skin]").on('click', function (e) {
      if($(this).hasClass('knob'))
        return;
      e.preventDefault();
      change_skin($(this).data('skin'));
    });

    //Add the layout manager
    $("[data-layout]").on('click', function () {
      change_layout($(this).data('layout'));
    });

    $("[data-controlsidebar]").on('click', function () {
      change_layout($(this).data('controlsidebar'));
      var slide = !AdminLTE.options.controlSidebarOptions.slide;
      AdminLTE.options.controlSidebarOptions.slide = slide;
      if (!slide)
        $('.control-sidebar').removeClass('control-sidebar-open');
    });

    $("[data-sidebarskin='toggle']").on('click', function () {
      var sidebar = $(".control-sidebar");
      if (sidebar.hasClass("control-sidebar-dark")) {
        sidebar.removeClass("control-sidebar-dark")
        sidebar.addClass("control-sidebar-light")
      } else {
        sidebar.removeClass("control-sidebar-light")
        sidebar.addClass("control-sidebar-dark")
      }
    });

    $("[data-enable='expandOnHover']").on('click', function () {
      $(this).attr('disabled', true);
      AdminLTE.pushMenu.expandOnHover();
      if (!$('body').hasClass('sidebar-collapse'))
        $("[data-layout='sidebar-collapse']").click();
    });

    // Reset options
    if ($('body').hasClass('fixed')) {
      $("[data-layout='fixed']").attr('checked', 'checked');
    }
    if ($('body').hasClass('layout-boxed')) {
      $("[data-layout='layout-boxed']").attr('checked', 'checked');
    }
    if ($('body').hasClass('sidebar-collapse')) {
      $("[data-layout='sidebar-collapse']").attr('checked', 'checked');
    }

  }
379517
public function setUp()
    {
        if ($this->filesystem->exists($this->outputDir) === false) {
            return;
        }

        $finder = new Finder();
        $finder->in($this->outputDir)
            ->depth('== 0');

        $this->filesystem->remove($finder);
    }
811469
protected function setupEngine()
	{
		$this->engine = new HandlebarsEngine;

		$loader = new HandlebarsLoader($this->viewManager);

		$partialLoader = new HandlebarsLoader($this->viewManager);
		$partialLoader->setPrefix('_');

		$this->engine->setLoader($loader);
		$this->engine->setPartialsLoader($partialLoader);
	}
316448
public void addToolbarButtons(ToolScreen toolScreen)
    {
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, JnlpFileScreen.WRITE_FILE, MenuConstants.PRINT, JnlpFileScreen.WRITE_FILE, null);
    }
421247
public void setup() {
        JadeAgentIntrospector.getMyInstance(this);
        LogActivator.logToFile(logger, this.getName(), Level.ALL);
        this.template = MessageTemplate.MatchAll();
        addBehaviour(new RequestServer());
    }
257141
public static function init() {

		if ( self::can_switch_themes() ) {
			add_action( 'admin_bar_menu', array( __CLASS__, 'admin_bar_menu' ), 90 );
			add_action( 'wp_ajax_tts_set_theme', array( __CLASS__, 'set_theme' ) );
		}

		load_plugin_textdomain( 'toolbar-theme-switcher', false, dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/lang' );
	}
736815
def setup_gui(self):
        """"""
        scrollarea = self.setup_scrollarea()
        up_btn, down_btn = self.setup_arrow_buttons()

        self.setFixedWidth(150)
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.setSpacing(0)
        layout.addWidget(up_btn)
        layout.addWidget(scrollarea)
        layout.addWidget(down_btn)
992420
private void setUpUtilBar() {
		utilBar.setLayout(new ListLayout(ListLayout.Type.FLAT, ListLayout.Alignment.RIGHT, ListLayout.Separator.NONE, false));
		WTextField selectOther = new WTextField();
		selectOther.setToolTip("Enter text.");
		utilBar.add(selectOther);
		utilBar.add(new WButton("Go"));
		utilBar.add(new WButton("A"));
		utilBar.add(new WButton("B"));
		utilBar.add(new WButton("C"));
		utilBar.setVisible(false);
	}
673729
private void setup() {

		setLayout(new FlowLayout(FlowLayout.VERTICAL));

		WFieldSet fset = new WFieldSet("Select a meal");
		add(fset);
		fset.setMargin(new Margin(null, null, Size.LARGE, null));

		WFieldLayout flay = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		fset.add(flay);
		flay.setLabelWidth(0);
		flay.addField("Breakfast", rb1);
		flay.addField("Lunch", rb2);
		flay.addField("Dinner", rb3);

		/*
		 * NOTE: you should never use submitOnChange with a WRadioButton
		 */
		fset.add(new WAjaxControl(mealSelections, textBox));

		mealSelections.setActionOnChange(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				String selection = null;

				if (rb1.isSelected()) {
					selection = "Breakfast selected";
				}

				if (rb2.isSelected()) {
					selection = "Lunch selected";
				}

				if (rb3.isSelected()) {
					selection = "Dinner selected";
				}

				text1.setText(selection + " : " + (new Date()).toString());
			}
		});

		textBox.add(text1);
		add(textBox);
		add(mealSelections);
	}
821499
def setup_other_windows(self):
        """"""

        self.toolbar_list = ((_("File toolbar"), "file_toolbar",
                              self.main.file_toolbar_actions),
                             (_("Search toolbar"), "search_toolbar",
                              self.main.search_menu_actions),
                             (_("Source toolbar"), "source_toolbar",
                              self.main.source_toolbar_actions),
                             (_("Run toolbar"), "run_toolbar",
                              self.main.run_toolbar_actions),
                             (_("Debug toolbar"), "debug_toolbar",
                              self.main.debug_toolbar_actions),
                             (_("Edit toolbar"), "edit_toolbar",
                              self.main.edit_toolbar_actions))
        self.menu_list = ((_("&File"), self.main.file_menu_actions),
                          (_("&Edit"), self.main.edit_menu_actions),
                          (_("&Search"), self.main.search_menu_actions),
                          (_("Sour&ce"), self.main.source_menu_actions),
                          (_("&Run"), self.main.run_menu_actions),
                          (_("&Tools"), self.main.tools_menu_actions),
                          (_("&View"), []),
                          (_("&Help"), self.main.help_menu_actions))
        # Create pending new windows:
        for layout_settings in self.editorwindows_to_be_created:
            win = self.create_new_window()
            win.set_layout_settings(layout_settings)
1025814
public void addToolbarButtons(ToolScreen toolScreen)
    {
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, ScriptScreen.GO, ScriptScreen.GO, ScriptScreen.GO, null);
    }
1084921
public function setup() {
		// do parent
		parent::setup();
		if ( ! isset( $this->struct['screen'] ) ) {
			$this->struct['screen'] = ( $this->parent ? $this->parent->slug : null );
		}
	}
626776
def setup_toolbar(self):
        """"""
        savefig_btn = create_toolbutton(
                self, icon=ima.icon('filesave'),
                tip=_("Save Image As..."),
                triggered=self.save_figure)

        saveall_btn = create_toolbutton(
                self, icon=ima.icon('save_all'),
                tip=_("Save All Images..."),
                triggered=self.save_all_figures)

        copyfig_btn = create_toolbutton(
            self, icon=ima.icon('editcopy'),
            tip=_("Copy plot to clipboard as image (%s)" %
                  get_shortcut('plots', 'copy')),
            triggered=self.copy_figure)

        closefig_btn = create_toolbutton(
                self, icon=ima.icon('editclear'),
                tip=_("Remove image"),
                triggered=self.close_figure)

        closeall_btn = create_toolbutton(
                self, icon=ima.icon('filecloseall'),
                tip=_("Remove all images from the explorer"),
                triggered=self.close_all_figures)

        vsep1 = QFrame()
        vsep1.setFrameStyle(53)

        goback_btn = create_toolbutton(
                self, icon=ima.icon('ArrowBack'),
                tip=_("Previous Figure ({})".format(
                      get_shortcut('plots', 'previous figure'))),
                triggered=self.go_previous_thumbnail)

        gonext_btn = create_toolbutton(
                self, icon=ima.icon('ArrowForward'),
                tip=_("Next Figure ({})".format(
                      get_shortcut('plots', 'next figure'))),
                triggered=self.go_next_thumbnail)

        vsep2 = QFrame()
        vsep2.setFrameStyle(53)

        zoom_out_btn = create_toolbutton(
                self, icon=ima.icon('zoom_out'),
                tip=_("Zoom out (Ctrl + mouse-wheel-down)"),
                triggered=self.zoom_out)

        zoom_in_btn = create_toolbutton(
                self, icon=ima.icon('zoom_in'),
                tip=_("Zoom in (Ctrl + mouse-wheel-up)"),
                triggered=self.zoom_in)

        self.zoom_disp = QSpinBox()
        self.zoom_disp.setAlignment(Qt.AlignCenter)
        self.zoom_disp.setButtonSymbols(QSpinBox.NoButtons)
        self.zoom_disp.setReadOnly(True)
        self.zoom_disp.setSuffix(' %')
        self.zoom_disp.setRange(0, 9999)
        self.zoom_disp.setValue(100)
        self.figviewer.sig_zoom_changed.connect(self.zoom_disp.setValue)

        zoom_pan = QWidget()
        layout = QHBoxLayout(zoom_pan)
        layout.setSpacing(0)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(zoom_out_btn)
        layout.addWidget(zoom_in_btn)
        layout.addWidget(self.zoom_disp)

        return [savefig_btn, saveall_btn, copyfig_btn, closefig_btn,
                closeall_btn, vsep1, goback_btn, gonext_btn, vsep2, zoom_pan]
1051133
function () {
        var self = this;

        self.items().each(function (ctrl) {
          ctrl.classes.add('toolbar-item');
        });

        return self._super();
      }