Create the button/panel for this menu item.
@param record The menu record.
@return The component to add to this panel.
179513
public JComponent createComponentButton(String strProductType, BaseApplet applet)
    {
        ProductTypeInfo productType = ProductTypeInfo.getProductType(strProductType);
        if (productType == null)
        {
            ImageIcon icon = null;
            if (applet != null)
                icon = applet.loadImageIcon(strProductType, null);
            productType = new ProductTypeInfo(strProductType, icon, icon, 0x00c0c0c0, Colors.NULL);
        }
        JUnderlinedButton button = new JUnderlinedButton(productType.getDescription(), productType.getStartIcon());

        String strLink = strProductType;
        button.setName(strLink);
        
        button.setOpaque(false);
        Color colorBackground = new Color(productType.getSelectColor());
        button.setBackground(colorBackground); // Since the button is opaque, this is only needed for those look and feels that want their own background color.
        button.setBorderPainted(false);
        button.addActionListener(m_actionListener);
        button.addActionListener(this);
        return button;
    }
863849
private void createButtonBar() {
		// Update and reset controls for the repeater.
		WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE);
		buttonPanel.setMargin(new Margin(Size.MEDIUM, null , Size.LARGE, null));
		buttonPanel.setLayout(new BorderLayout());

		WButton updateButton = new WButton("Update");
		updateButton.setImage("/image/document-save-5.png");
		updateButton.setImagePosition(WButton.ImagePosition.EAST);
		buttonPanel.add(updateButton, BorderLayout.EAST);

		WButton resetButton = new WButton("Reset");
		resetButton.setImage("/image/edit-undo-8.png");
		resetButton.setImagePosition(WButton.ImagePosition.WEST);
		resetButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				repeater.setData(fetchDataList());
			}
		});
		buttonPanel.add(resetButton, BorderLayout.WEST);
		add(buttonPanel);
		add(new WAjaxControl(updateButton, repeater));
		add(new WAjaxControl(resetButton, repeater));
	}
1309398
def editRecord(self, record, pos=None):
        
        
        typ = type(record)
        editor = self._recordEditors.get(typ)
        if not editor:
            return False
        
        if self.popupEditing():
            popup = self.popupWidget()
            edit = popup.centralWidget()
            
            # create a new editor if required
            if type(edit) != editor:
                if edit:
                    edit.close()
                    edit.deleteLater()
                
                edit = editor(popup)
                edit.setAutoCommitOnSave(True)
                popup.setCentralWidget(edit)
                popup.accepted.connect(edit.save)
                edit.aboutToSaveRecord.connect(self.recordUpdated)
                edit.saved.connect(self.refresh)
            
            edit.setRecord(record)
            popup.popup(pos)
        
        else:
            if editor.edit(record, autoCommit=False):
                self.recordUpdated.emit(record)
                record.commit()
                self.refresh()
        
        return True
768401
@SuppressWarnings("unchecked")
	public long addRecord(T record) throws IOException {

		if (recordsOutFile == null) {
			
			if (closed) {
				throw new IllegalStateException("The large record handler has been closed.");
			}
			if (recordsReader != null) {
				throw new IllegalStateException("The handler has already switched to sorting.");
			}
			
			LOG.debug("Initializing the large record spilling...");
			
			// initialize the utilities
			{
				final TypeComparator<?>[] keyComps = comparator.getFlatComparators();
				numKeyFields = keyComps.length;
				Object[] keyHolder = new Object[numKeyFields];
				
				comparator.extractKeys(record, keyHolder, 0);
				
				TypeSerializer<?>[] keySers = new TypeSerializer<?>[numKeyFields];
				TypeSerializer<?>[] tupleSers = new TypeSerializer<?>[numKeyFields + 1];
				
				int[] keyPos = new int[numKeyFields];
				
				for (int i = 0; i < numKeyFields; i++) {
					keyPos[i] = i;
					keySers[i] = createSerializer(keyHolder[i], i);
					tupleSers[i] = keySers[i];
				}
				// add the long serializer for the offset
				tupleSers[numKeyFields] = LongSerializer.INSTANCE;
				
				keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers);
				keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);
				
				keySerializerFactory = new RuntimeSerializerFactory<Tuple>(keySerializer, keySerializer.getTupleClass());

				keyTuple = keySerializer.createInstance();
			}
			
			// initialize the spilling
			final int totalNumSegments = memory.size();
			final int segmentsForKeys = (totalNumSegments >= 2*MAX_SEGMENTS_FOR_KEY_SPILLING) ? MAX_SEGMENTS_FOR_KEY_SPILLING : 
				Math.max(MIN_SEGMENTS_FOR_KEY_SPILLING, totalNumSegments - MAX_SEGMENTS_FOR_KEY_SPILLING);
				
			List<MemorySegment> recordsMemory = new ArrayList<MemorySegment>();
			List<MemorySegment> keysMemory = new ArrayList<MemorySegment>();
			
			for (int i = 0; i < segmentsForKeys; i++) {
				keysMemory.add(memory.get(i));
			}
			for (int i = segmentsForKeys; i < totalNumSegments; i++) {
				recordsMemory.add(memory.get(i));
			}
			
			recordsChannel = ioManager.createChannel();
			keysChannel = ioManager.createChannel();
			
			recordsOutFile = new FileChannelOutputView(
					ioManager.createBlockChannelWriter(recordsChannel), memManager,
					recordsMemory, memManager.getPageSize());
			
			keysOutFile = new FileChannelOutputView(
					ioManager.createBlockChannelWriter(keysChannel), memManager,
					keysMemory, memManager.getPageSize());
		}
		
		final long offset = recordsOutFile.getWriteOffset();
		if (offset < 0) {
			throw new RuntimeException("wrong offset");
		}
		
		Object[] keyHolder = new Object[numKeyFields];
		
		comparator.extractKeys(record, keyHolder, 0);
		for (int i = 0; i < numKeyFields; i++) {
			keyTuple.setField(keyHolder[i], i);
		}
		keyTuple.setField(offset, numKeyFields);
		
		keySerializer.serialize(keyTuple, keysOutFile);
		serializer.serialize(record, recordsOutFile);
		
		recordCounter++;
		
		return offset;
	}
1130456
public synchronized void writeRecord(String record) {
        long length = record.length() + nlen;
        PrintStream ps = getPrintStream(length, null);
        ps.println(record);
    }
987967
public BasePanel makeSubScreen()
    {
        SwitchClassSub listener = new SwitchClassSub(null, null, null)
        {
            public BasePanel getSubScreen(BasePanel parentScreen, ScreenLocation screenLocation, Map<String, Object> properties, int screenNo)
            {
                BasePanel subScreen = super.getSubScreen(parentScreen, screenLocation, properties, screenNo);
                if (subScreen != null)
                {
                    Record record = subScreen.getMainRecord();
                    if (record != null)
                        if (record != getMainRecord())
                    {   // Make sure classinfo is updated when detail is update, so I can write on exit
                        record.addListener(new DateChangedHandler((DateTimeField)getMainRecord().getField(ClassInfo.LAST_CHANGED)));
                    }
                }
                return subScreen;
            }
            
        };
        this.getScreenRecord().getField(ClassVars.CLASS_KEY).addListener(listener);
        this.getScreenRecord().getField(ClassVars.CLASS_KEY).setValue(5, DBConstants.DISPLAY, DBConstants.SCREEN_MOVE);
        return (BasePanel)listener.getSubScreen();
    }
32017
protected static function create($record) {
        global $DB;
        if (empty($record->tagcollid)) {
            $record->tagcollid = core_tag_collection::get_default();
        }
        $DB->insert_record('tag_area', array('component' => $record->component,
            'itemtype' => $record->itemtype,
            'tagcollid' => $record->tagcollid,
            'callback' => $record->callback,
            'callbackfile' => $record->callbackfile,
            'showstandard' => isset($record->showstandard) ? $record->showstandard : core_tag_tag::BOTH_STANDARD_AND_NOT,
            'multiplecontexts' => isset($record->multiplecontexts) ? $record->multiplecontexts : 0));

        // Reset cache.
        cache::make('core', 'tags')->delete('tag_area');
    }
373550
@SuppressWarnings({ "unchecked", "rawtypes" })
	private JPanel createButtonsPanel() {
		final JComboBox requestComboBox = new JComboBox(
				databaseInformations.getRequestNames().toArray());
		requestComboBox.setFont(requestComboBox.getFont().deriveFont(Font.BOLD));
		requestComboBox.setSelectedIndex(databaseInformations.getSelectedRequestIndex());
		requestComboBox.setRenderer(new DefaultListCellRenderer() {
			private static final long serialVersionUID = 1L;

			@Override
			public Component getListCellRendererComponent(JList list, Object value, int index,
					boolean isSelected, boolean cellHasFocus) {
				final String requestKey = (String) value;
				final String label = getString(requestKey);
				return super.getListCellRendererComponent(list, label, index, isSelected,
						cellHasFocus);
			}
		});
		requestComboBox.addItemListener(new ItemListener() {
			@Override
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED) {
					final int requestIndex = requestComboBox.getSelectedIndex();
					try {
						refresh(requestIndex);
					} catch (final IOException ex) {
						showException(ex);
					}
				}
			}
		});

		final MButton refreshButton = createRefreshButton();
		refreshButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					refresh(getDatabaseInformations().getSelectedRequestIndex());
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});
		final MButton pdfButton = createPdfButton();
		pdfButton.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				try {
					actionPdf();
				} catch (final IOException ex) {
					showException(ex);
				}
			}
		});
		final MButton xmlJsonButton = createXmlJsonButton(databaseInformations);

		return Utilities.createButtonsPanel(requestComboBox, new JLabel("             "),
				refreshButton, pdfButton, xmlJsonButton);
	}
838935
public BasePanel makeSubScreen()
    {
        if (this.isContactDisplay())
            return null;
        Record recHeader = this.getHeaderRecord();
        Record recMessageLog = this.getMainRecord();
        if (recHeader instanceof Company)   // Profile
            ((ReferenceField)recMessageLog.getField(MessageLog.CONTACT_ID)).setReferenceRecord(recHeader);   // Make sure this is hooked up
        return new MessageLogHeaderScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
    }
426249
protected Button newButton(final String id)
	{
		return new Button(id)
		{
			/** The serialVersionUID. */
			private static final long serialVersionUID = 1L;

			@Override
			public void onSubmit()
			{
				onSignup(ComponentFinder.findOrCreateNewAjaxRequestTarget(), getForm());
			}
		};
	}
52773
public BasePanel makeSubScreen()
    {
        Record recHeader = this.getHeaderRecord();
        Record recMessageDetail = this.getMainRecord();        
        if (recHeader instanceof Company)   // Profile
            ((ReferenceField)recMessageDetail.getField(MessageDetail.PERSON_ID)).setReferenceRecord(recHeader);   // Make sure this is hooked up
        return new MessageDetailHeaderScreen(null, this, null, ScreenConstants.DONT_DISPLAY_FIELD_DESC, null);
    }
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);
    }
796988
public Record getMainRecord()
    {
        if (this.getScreenField() instanceof BasePanel)
            return ((BasePanel)this.getScreenField()).getMainRecord();
        else
            return this.getScreenField().getParentScreen().getMainRecord();
    }
839809
public final BaseTable makeTable(Record record)
    {
        BaseTable table = this.doMakeTable(record);
        
        if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty(DBConstants.BASE_TABLE_ONLY)))
        	return this.returnBaseTable(table);
        int iRawDBType = (record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK);
        if ((iRawDBType == DBConstants.LOCAL)
                || (iRawDBType == DBConstants.REMOTE) || (iRawDBType == DBConstants.TABLE))
            if ((this.getMasterSlave() & RecordOwner.SLAVE) == RecordOwner.SLAVE) // Do this at the server only
        {
            if ((record.getDatabaseType() & DBConstants.LOCALIZABLE) == DBConstants.LOCALIZABLE)
            {
                m_databaseLocale = this.makeDBLocale(record, m_databaseLocale); // Check the local database to make sure it is correct
                if (m_databaseLocale != this)
                    table = this.makeResourceTable(record, table, m_databaseLocale, false);   // Add the locale capability if it exists
            }
            if (m_databaseBase != null)
                if ((record.getDatabaseType() & DBConstants.HIERARCHICAL) == DBConstants.HIERARCHICAL)
                    table = this.makeResourceTable(record, table, m_databaseBase, true);   // Add the base database if it exists
        }
        return table;
    }
738623
public void setRecord(Rec record)
    {
        if (m_tableNext != null)
            m_tableNext.setRecord(record);  // Must be synchronized
        super.setRecord(record);
    }
379098
public int putRawRecordData(Rec record)
    {
        if (this.getNodeType() == BaseMessageRecordDesc.NON_UNIQUE_NODE)
            this.getMessage().createNewNode(this.getFullKey(null));
        return super.putRawRecordData(record);
    }
723481
public void init(Object parent, Object record)
    {
        if (parent instanceof BaseApplet)
            m_strInitParam = ((BaseApplet)parent).getProperty(Params.MENU);
        super.init(parent, record);
    }