All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fife.tmm.OperatorsPanel Maven / Gradle / Ivy

Go to download

An application to easily create syntax highlighting for custom languages in RSyntaxTextArea.

The newest version!
package org.fife.tmm;

import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JPanel;

import org.fife.ui.UIUtil;


/**
 * A panel for editing the language's operators.
 *
 * @author Robert Futrell
 * @version 1.0
 */
class OperatorsPanel extends TmmPanel {

	private WordsTable operatorsTable;


	/**
	 * Constructor.
	 *
	 * @param app The parent application.
	 */
	OperatorsPanel(TokenMakerMaker app) {
		super(app);
		operatorsTable = new WordsTable(app, "Operator");
		panel.setLayout(new BorderLayout());
		JPanel temp = UIUtil.newTabbedPanePanel();
		temp.setLayout(new BorderLayout());
		temp.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
		JButton useCOperatorsButton = new JButton(
						new UseCOperatorsAction(app, operatorsTable));
		temp.add(useCOperatorsButton, BorderLayout.LINE_START);
		panel.add(temp, BorderLayout.NORTH);
		panel.setBorder(UIUtil.getEmpty5Border());
		panel.add(operatorsTable);
	}


	/**
	 * {@inheritDoc}
	 */
	@Override
	public void configureTokenMakerInfo(TokenMakerInfo info) {
		info.setOperators(operatorsTable.getWords());
	}


	/**
	 * {@inheritDoc}
	 */
	@Override
	public void initializeFrom(TokenMakerInfo info) {
		operatorsTable.setWords(info.getOperators());
	}


	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean verifyInput() {
		return true;
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy