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

edu.stanford.smi.protege.widget.ReadOnlyWidgetConfigurationPanel Maven / Gradle / Ivy

Go to download

Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.

There is a newer version: 3.5.1
Show newest version
package edu.stanford.smi.protege.widget;

import java.awt.GridLayout;

import javax.swing.JCheckBox;

import edu.stanford.smi.protege.util.AbstractValidatableComponent;
import edu.stanford.smi.protege.util.LabeledComponent;

public class ReadOnlyWidgetConfigurationPanel extends AbstractValidatableComponent{

	private static final long serialVersionUID = 8496065403491429614L;
    private AbstractSlotWidget widget;
	private JCheckBox readOnlyCheckBox;

	public ReadOnlyWidgetConfigurationPanel(AbstractSlotWidget widget) {
		this.widget = widget;
		
		setLayout(new GridLayout(0,1,10,10));
		
		readOnlyCheckBox = new JCheckBox("Read-only (Users will not be able to edit the value of this widget)");
		readOnlyCheckBox.setSelected(widget.isReadOnlyConfiguredWidget());
		
		LabeledComponent labledComp = new LabeledComponent("Options", readOnlyCheckBox, true);
		add(labledComp);
	}
		
	
	public void saveContents() {
		widget.setReadOnlyWidget(readOnlyCheckBox.isSelected());	
	}

	public boolean validateContents() {	
		return true;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy