Initializes the download button.<p>
557531
protected void initDownloadButton() {

        if (m_fileDownloader != null) {
            m_fileDownloader.remove();
        }
        m_fileDownloader = new FileDownloader(getDownloadResource());
        m_fileDownloader.extend(getDownloadButton());
    }
1066432
private void initializeDynamicPreferenceButton() {
        Button dynamicPreferenceButton = findViewById(R.id.dynamic_preference_button);
        dynamicPreferenceButton.setOnClickListener(createDynamicPreferenceButtonListener());
    }
126645
private void initialize() {
        this.setTitle(Constant.messages.getString("history.managetags.title"));
        this.setContentPane(getJPanel());
        if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
        	this.setSize(panelWidth, panelHeight);
        }
        this.addWindowListener(new java.awt.event.WindowAdapter() {   
        	@Override
        	public void windowOpened(java.awt.event.WindowEvent e) {    
        	} 

        	@Override
        	public void windowClosing(java.awt.event.WindowEvent e) {
        	}
        });

		pack();
	}
966339
private void initialize() {
        this.setTitle(Constant.messages.getString("edit.find.title"));
        this.infoLabel = new JLabel(Constant.messages.getString("edit.find.label.notfound"));
        this.infoLabel.setVisible(false);
        this.setContentPane(getJPanel());
        centreDialog();
        txtFind.requestFocus();
        this.getRootPane().setDefaultButton(btnFind);
        pack();
        this.setVisible(true);
	}
664687
private void initialize() {
		this.setVisible(false);
		this.setIconImages(DisplayUtils.getZapIconImages());
		this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
	    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
	    	this.setSize(300,200);
	    }
		this.setTitle(Constant.PROGRAM_NAME);
		
        //  Handle escape key to close the dialog    
        KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
        AbstractAction escapeAction = new AbstractAction() {
			private static final long serialVersionUID = 3516424501887406165L;
			@Override
            public void actionPerformed(ActionEvent e) {
				dispatchEvent(new WindowEvent(AbstractDialog.this, WindowEvent.WINDOW_CLOSING));
            }
        };
        getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE");
        getRootPane().getActionMap().put("ESCAPE",escapeAction);
	}
1074553
private void initialize() {
        this.setTitle(Constant.messages.getString("siteselect.dialog.title"));
        this.setContentPane(getJPanel());
        this.addWindowListener(new java.awt.event.WindowAdapter() {   
        	@Override
        	public void windowOpened(java.awt.event.WindowEvent e) {    
        	} 

        	@Override
        	public void windowClosing(java.awt.event.WindowEvent e) {    
        	    cancelButton.doClick();
        	}
        });
		pack();
	}
1146279
private void init()
	{
		setSize(600, 400);
		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		getContentPane().setLayout(new BorderLayout());
		getContentPane().setBackground(BACKGROUND);

		JPanel modelPanel = new JPanel(new GridBagLayout());

		pcRadio = new JRadioButton("Use Pathway Commons");
		pcRadio.addActionListener(this);
		pcRadio.setBackground(BACKGROUND);
		GridBagConstraints con = new GridBagConstraints();
		con.gridx = 0;
		con.gridy = 0;
		con.anchor = GridBagConstraints.LINE_START;
		modelPanel.add(pcRadio, con);

		pcCombo = new JComboBox(PC_RES_NAMES);
		pcCombo.setBackground(BACKGROUND);
		con = new GridBagConstraints();
		con.gridx = 1;
		con.gridy = 0;
		con.anchor = GridBagConstraints.CENTER;
		con.ipadx = 5;
		modelPanel.add(pcCombo, con);

		customFileRadio = new JRadioButton("Use custom file");
		customFileRadio.addActionListener(this);
		customFileRadio.setBackground(BACKGROUND);
		con = new GridBagConstraints();
		con.gridx = 0;
		con.gridy = 1;
		con.anchor = GridBagConstraints.LINE_START;
		modelPanel.add(customFileRadio, con);

		JPanel modelChooserPanel = new JPanel(new FlowLayout());
		modelField = new JTextField(15);
		modelField.addKeyListener(this);
		modelField.setEnabled(false);
		modelChooserPanel.add(modelField);
		loadButton = new JButton("Load");
		loadButton.addActionListener(this);
		loadButton.setEnabled(false);
		modelChooserPanel.add(loadButton);
		modelChooserPanel.setBackground(BACKGROUND);
		con = new GridBagConstraints();
		con.gridx = 1;
		con.gridy = 1;
		con.anchor = GridBagConstraints.CENTER;
		modelPanel.add(modelChooserPanel, con);

		customURLRadio = new JRadioButton("Use the owl at URL");
		customURLRadio.addActionListener(this);
		customURLRadio.setBackground(BACKGROUND);
		con = new GridBagConstraints();
		con.gridx = 0;
		con.gridy = 2;
		con.anchor = GridBagConstraints.LINE_START;
		modelPanel.add(customURLRadio, con);

		urlField = new JTextField(15);
		urlField.addKeyListener(this);
		urlField.setEnabled(false);
		con = new GridBagConstraints();
		con.gridx = 1;
		con.gridy = 2;
		con.anchor = GridBagConstraints.LINE_START;
		modelPanel.add(urlField, con);

		ButtonGroup group = new ButtonGroup();
		group.add(pcRadio);
		group.add(customFileRadio);
		group.add(customURLRadio);
		group.setSelected(pcRadio.getModel(), true);

		modelPanel.setBorder(BorderFactory.createTitledBorder("Source model"));
		modelPanel.setBackground(BACKGROUND);

		getContentPane().add(modelPanel, BorderLayout.NORTH);

		JPanel minerPanel = new JPanel(new BorderLayout());
		minerPanel.setBackground(BACKGROUND);
		minerPanel.setBorder(BorderFactory.createTitledBorder("Pattern to search"));
		JPanel comboPanel = new JPanel(new FlowLayout());
		comboPanel.setBackground(BACKGROUND);
		JLabel patternLabel = new JLabel("Pattern: ");
		patternCombo = new JComboBox(getAvailablePatterns());
		patternCombo.addActionListener(this);
		patternCombo.setBackground(BACKGROUND);
		comboPanel.add(patternLabel);
		comboPanel.add(patternCombo);
		minerPanel.add(comboPanel, BorderLayout.NORTH);

		descArea = new JTextArea(30, 3);
		descArea.setEditable(false);
		descArea.setBorder(BorderFactory.createTitledBorder("Description"));
		descArea.setText(((Miner) patternCombo.getSelectedItem()).getDescription());
		descArea.setLineWrap(true);
		descArea.setWrapStyleWord(true);
		minerPanel.add(descArea, BorderLayout.CENTER);

		JPanel progressPanel = new JPanel(new GridBagLayout());
		progressPanel.setBackground(BACKGROUND);
		prgLabel = new JLabel("                       ");
		prgBar = new JProgressBar();
		prgBar.setStringPainted(true);
		prgBar.setVisible(false);
		con = new GridBagConstraints();
		con.gridx = 0;
		con.anchor = GridBagConstraints.CENTER;
		con.ipady = 12;
		con.ipadx = 10;
		progressPanel.add(prgLabel, con);
		con = new GridBagConstraints();
		con.gridx = 1;
		con.anchor = GridBagConstraints.LINE_END;
		progressPanel.add(prgBar, con);

		minerPanel.add(progressPanel, BorderLayout.SOUTH);

		getContentPane().add(minerPanel, BorderLayout.CENTER);

		JPanel finishPanel = new JPanel(new BorderLayout());

		JPanel lowerPanel = new JPanel(new FlowLayout());
		lowerPanel.setBackground(BACKGROUND);
		outputField = new JTextField(20);
		outputField.setBorder(BorderFactory.createTitledBorder("Output file"));
		outputField.addActionListener(this);
		outputField.addKeyListener(this);
		outputField.setText(((Miner) patternCombo.getSelectedItem()).getName() + ".txt");

		finishPanel.add(outputField, BorderLayout.WEST);

		runButton = new JButton("Run");
		runButton.addActionListener(this);
		finishPanel.add(runButton, BorderLayout.EAST);

		JPanel bufferPanel = new JPanel(new FlowLayout());
		bufferPanel.setMinimumSize(new Dimension(300, 10));
		bufferPanel.setBackground(BACKGROUND);
		bufferPanel.add(new JLabel("    "));
		finishPanel.add(bufferPanel, BorderLayout.CENTER);
		finishPanel.setBackground(BACKGROUND);

		lowerPanel.add(finishPanel);

		getContentPane().add(lowerPanel, BorderLayout.SOUTH);
	}
112584
private I_CmsUploadButtonHandler createButtonHandler() {

        I_CmsUploadButtonHandler buttonHandler = null;
        switch (getState().getUploadType()) {
            case singlefile:
                buttonHandler = new CmsSingleFileUploadHandler(
                    new ButtonContextSupplier(),
                    getState().getDialogTitle());
                ((CmsSingleFileUploadHandler)buttonHandler).setTargetFolderPath(getState().getTargetFolderRootPath());
                ((CmsSingleFileUploadHandler)buttonHandler).setTargetFileName(getState().getTargetFileName());
                ((CmsSingleFileUploadHandler)buttonHandler).setTargetFileNamePrefix(
                    getState().getTargetFileNamePrefix());
                break;
            case multifile:
            default:
                buttonHandler = new CmsDialogUploadButtonHandler(new ButtonContextSupplier());
                ((CmsDialogUploadButtonHandler)buttonHandler).setIsTargetRootPath(true);
                ((CmsDialogUploadButtonHandler)buttonHandler).setTargetFolder(getState().getTargetFolderRootPath());
                break;
        }
        return buttonHandler;
    }
1304964
private void initialize() {
		this.setContentPane(getJContentPane());
        this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        this.setTitle(TITLE);
		this.addWindowListener(new java.awt.event.WindowAdapter() {
		    @Override
		    public void windowClosing(WindowEvent winEvt) {
				  stop();
                  BrowserDialog.this.setVisible(false);
		    }
		});
        pack();
	    if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
	    	this.setSize(640,480);
	    }

	}
1339530
private void initialize() {
    this.setSize(300, 200);
    this.setTitle("Connect");
    this.setContentPane(getJContentPane());
    this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    this.addWindowListener(new WindowAdapter() {
      public void windowClosed(WindowEvent e) {
        cancelTimeout();
      }
    });

    Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
      public void eventDispatched(AWTEvent e) {
        if ((e instanceof KeyEvent && ((KeyEvent) e).getID() == KeyEvent.KEY_PRESSED)
            || (e instanceof MouseEvent && ((MouseEvent) e).getID() == MouseEvent.MOUSE_PRESSED)) {
          if (ConnectionDialog.this.isAncestorOf(((ComponentEvent) e).getComponent())) {
            cancelTimeout();
          }
        }
      }
    }, AWTEvent.KEY_EVENT_MASK | AWTEvent.MOUSE_EVENT_MASK);
    restore();
  }
590473
private void initButtons() {

        m_addButton.addChoice(
            m_attributeHandler.getWidgetService(),
            new CmsChoiceMenuEntryBean(m_attributeHandler.getAttributeName()),
            new AsyncCallback<CmsChoiceMenuEntryBean>() {

                public void onFailure(Throwable caught) {

                    // will not be called

                }

                public void onSuccess(CmsChoiceMenuEntryBean selectedEntry) {

                    // nothing to do
                }
            });
        m_addButton.addDomHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                m_addButton.hide();
                addNewAttributeValue();
                event.preventDefault();
                event.stopPropagation();

            }
        }, ClickEvent.getType());

        m_editButton.setImageClass(I_CmsButton.PEN_SMALL);
        m_editButton.setButtonStyle(ButtonStyle.FONT_ICON, null);

        m_removeButton.setImageClass(I_CmsButton.CUT_SMALL);
        m_removeButton.setButtonStyle(ButtonStyle.FONT_ICON, null);

        m_upButton.setImageClass(I_CmsButton.EDIT_UP_SMALL);
        m_upButton.setButtonStyle(ButtonStyle.FONT_ICON, null);

        m_downButton.setImageClass(I_CmsButton.EDIT_DOWN_SMALL);
        m_downButton.setButtonStyle(ButtonStyle.FONT_ICON, null);

        if (CmsEditorBase.hasDictionary()) {
            String label = m_widgetService.getAttributeLabel(m_attributeHandler.getAttributeName());
            m_addButton.setTitle(CmsEditorBase.getMessageForKey(CmsEditorBase.GUI_VIEW_ADD_1, label));
            m_removeButton.setTitle(CmsEditorBase.getMessageForKey(CmsEditorBase.GUI_VIEW_DELETE_1, label));
            m_upButton.setTitle(CmsEditorBase.getMessageForKey(CmsEditorBase.GUI_VIEW_MOVE_UP_0));
            m_downButton.setTitle(CmsEditorBase.getMessageForKey(CmsEditorBase.GUI_VIEW_MOVE_DOWN_0));
            m_title = CmsEditorBase.getMessageForKey(CmsEditorBase.GUI_VIEW_EDIT_1, label);
            m_editButton.setTitle(m_title);
        }
    }
1358261
private void initializeViews() {
        directoryTitle = (TextView) findViewById(R.id.file_directory_title);
        addButton = (MaterialFloatingActionButton) findViewById(R.id.file_picker_add_button);
        addButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                NameFileDialog nfd = NameFileDialog.newInstance();
                nfd.show(getFragmentManager(), "NameDialog");
            }
        });

        if (fabColorId != -1) {
            addButton.setButtonColor(getResources().getColor(fabColorId));
        }
        selectButton = (Button) findViewById(R.id.select_button);
        selectButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (requestCode == Request.DIRECTORY) {
                    if (currentFile.isDirectory()) {
                        curDirectory = currentFile;
                        data = new Intent();
                        data.putExtra(FILE_EXTRA_DATA_PATH, currentFile.getAbsolutePath());
                        setResult(RESULT_OK, data);
                        finish();
                    } else {
                        Snackbar.make(getWindow().getDecorView(), R.string.file_picker_snackbar_select_directory_message, Snackbar.LENGTH_SHORT).show();
                    }
                } else { //request code is for a file
                    if (currentFile.isDirectory()) {
                        curDirectory = currentFile;
                        new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
                    } else {
                        if (!TextUtils.isEmpty(mimeType)) {
                            MimeTypeMap mimeTypeMap = MimeTypeMap.getSingleton();
                            String requiredExtension = "." + mimeTypeMap.getExtensionFromMimeType(mimeType);
                            if (requiredExtension.equalsIgnoreCase(fileExt(currentFile.toString()))) {
                                data = new Intent();
                                data.putExtra(FILE_EXTRA_DATA_PATH, currentFile.getAbsolutePath());
                                setResult(RESULT_OK, data);
                                finish();
                            } else {
                                Snackbar.make(getWindow().getDecorView(), String.format(getString(R.string.file_picker_snackbar_select_file_ext_message), requiredExtension), Snackbar.LENGTH_SHORT).show();
                            }
                        } else {
                            data = new Intent();
                            data.putExtra(FILE_EXTRA_DATA_PATH, currentFile.getAbsolutePath());
                            setResult(RESULT_OK, data);
                            finish();
                        }
                    }
                }
            }
        });

        openButton = (Button) findViewById(R.id.open_button);
        openButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (currentFile.isDirectory()) {
                    curDirectory = currentFile;
                    directoryTitle.setText(curDirectory.getName());

                    new UpdateFilesTask(FilePickerActivity.this).execute(curDirectory);
                } else {
                    Intent newIntent = new Intent(Intent.ACTION_VIEW);
                    String file = currentFile.toString();
                    if (file != null) {
                        newIntent.setDataAndType(Uri.fromFile(currentFile), mimeType);
                        newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        try {
                            startActivity(newIntent);
                        } catch (ActivityNotFoundException e) {
                            Snackbar.make(getWindow().getDecorView(), R.string.file_picker_snackbar_no_file_type_handler, Snackbar.LENGTH_SHORT).show();
                        }
                    } else {
                        Snackbar.make(getWindow().getDecorView(), R.string.file_picker_snackbar_no_read_type, Snackbar.LENGTH_SHORT).show();
                    }

                }
            }
        });

        buttonContainer = (LinearLayout) findViewById(R.id.button_container);
        buttonContainer.setVisibility(View.INVISIBLE);

        header = (RelativeLayout) findViewById(R.id.header_container);
    }
164326
private void init(final Window window) {

        CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);
        m_warningIcon.setContentMode(ContentMode.HTML);
        m_warningIcon.setValue(FontOpenCms.WARNING.getHtml());
        if (window != null) {
            m_cancel.addClickListener(e -> window.close());
        }
        m_table.setWidth("100%");
        m_table.setHeight("100%");

        List<CmsModuleRow> rows = new ArrayList<CmsModuleRow>();
        for (CmsModule module : OpenCms.getModuleManager().getAllInstalledModules()) {
            CmsModuleRow row = new CmsModuleRow(module);
            rows.add(row);
        }
        CmsBeanTableBuilder<CmsModuleRow> builder = CmsBeanTableBuilder.newInstance(CmsModuleRow.class);
        builder.buildTable(m_table, rows);
        m_table.setCellStyleGenerator(builder.getDefaultCellStyleGenerator());
        m_table.setItemIconPropertyId("icon");
        m_table.setRowHeaderMode(RowHeaderMode.ICON_ONLY);
        m_table.setSelectable(true);
        m_table.setVisibleColumns("name", "title");
        m_table.setSortContainerPropertyId("name");
        m_table.sort();

        m_filter.setIcon(FontOpenCms.FILTER);
        m_filter.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_FILTER_0));
        m_filter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
        m_filter.addTextChangeListener(new TextChangeListener() {

            public void textChange(TextChangeEvent event) {

                filterTable(event.getText());

            }
        });
    }
835224
public static void downloadFile() throws IOException {

		initPath();

		initServerName();

		String localName = getLocalFileName();

		String u = serverName + "/" + COMPONENTS_FILE_LOCATION;

		downloadFileFromRemote(new URL(u), new File(localName));


	}
640669
private void initialize() {
		this.setCursor(new java.awt.Cursor(java.awt.Cursor.WAIT_CURSOR));
		this.setResizable(false);
		this.setContentPane(getAboutPanel());
		this.pack();
		centerFrame();
	}
428989
@Override
    protected void initContent() {

        if (CmsStringUtil.isNotEmpty(getParamContent())) {
            if (CmsStringUtil.isNotEmpty(getParamElementname())
                && getParamElementname().equals(getParamOldelementname())) {
                if (CmsStringUtil.isNotEmpty(getParamElementlanguage())
                    && getParamElementlanguage().equals(getParamOldelementlanguage())) {
                    return;
                }
            }
        }
        getCms().getRequestContext().setAttribute(CmsRequestContext.ATTRIBUTE_EDITOR, Boolean.TRUE);

        String elementData;
        if (m_page.hasValue(getParamElementname(), getElementLocale())) {
            // element value is available in the page
            elementData = m_page.getStringValue(getCms(), getParamElementname(), getElementLocale());
        } else {
            // value is not available in the page
            if (Boolean.valueOf(getParamDirectedit()).booleanValue()) {
                // direct edit on a non-existing element: create new element with this name
                m_page.addValue(getParamElementname(), getElementLocale());
            }
            elementData = "";
        }
        setParamContent(elementData);
    }
854689
private void init() {

        m_height = -1;
        m_width = -1;
        m_maxHeight = -1;
        m_maxWidth = -1;
        m_type = 0;
        m_position = 0;
        m_renderMode = 0;
        m_quality = 0;
        m_cropX = -1;
        m_cropY = -1;
        m_cropHeight = -1;
        m_cropWidth = -1;
        m_color = Color.WHITE;
        m_filters = new ArrayList<String>();
        m_maxBlurSize = CmsImageLoader.getMaxBlurSize();
        m_isOriginalScaler = false;
    }