<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://protegewiki.stanford.edu/index.php?action=history&amp;feed=atom&amp;title=Changing_forms_programtically</id>
		<title>Changing forms programtically - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://protegewiki.stanford.edu/index.php?action=history&amp;feed=atom&amp;title=Changing_forms_programtically"/>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;action=history"/>
		<updated>2026-04-05T13:29:08Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=2248&amp;oldid=prev</id>
		<title>JenniferVendetti at 22:55, May 27, 2008</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=2248&amp;oldid=prev"/>
				<updated>2008-05-27T22:55:22Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:55, May 27, 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot; &gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Protege &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Developer Documentation]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Protege &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;developer documentation&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[Category:Protege 3 Documentation&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JenniferVendetti</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=2207&amp;oldid=prev</id>
		<title>JenniferVendetti: categorizing page</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=2207&amp;oldid=prev"/>
				<updated>2008-05-22T23:26:30Z</updated>
		
		<summary type="html">&lt;p&gt;categorizing page&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:26, May 22, 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot; &gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;formWidget.replaceWidget(testSlot, null);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;formWidget.replaceWidget(testSlot, null);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Protege Developer Documentation]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Protege 3 Documentation]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JenniferVendetti</name></author>	</entry>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=1171&amp;oldid=prev</id>
		<title>TaniaTudorache: New page: == Changing forms programmatically ==  The Protege API provides access also to the forms configuration. An application can change programmatically the display of a class or an instance the...</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=Changing_forms_programtically&amp;diff=1171&amp;oldid=prev"/>
				<updated>2008-01-03T22:50:45Z</updated>
		
		<summary type="html">&lt;p&gt;New page: == Changing forms programmatically ==  The Protege API provides access also to the forms configuration. An application can change programmatically the display of a class or an instance the...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Changing forms programmatically ==&lt;br /&gt;
&lt;br /&gt;
The Protege API provides access also to the forms configuration. An application can change programmatically the display of a class or an instance the same way in which it is changed in the Forms tab in the Protege UI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Replacing the slot widget for a class ===&lt;br /&gt;
&lt;br /&gt;
A class display is made up of slot widgets. For each slot type, there is a default slot widget used to display the value of the slot. For example, slot of type String and cardinality single has as a default slot widget, the TextFieldWidget.&lt;br /&gt;
&lt;br /&gt;
An application can replace the widget used to display a slot on a class form. The following code uses the Newspaper project and replaces the slot widget for slot &amp;lt;code&amp;gt;other_information&amp;lt;/code&amp;gt; for class &amp;lt;code&amp;gt;Editor&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;TextAreaWidget&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;TextFieldWidget&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
//the class for which the form needs to be customized&lt;br /&gt;
Cls editorCls = kb.getCls(&amp;quot;Editor&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
FormWidget formWidget = (FormWidget) kb.getProject().getDesignTimeClsWidget(editorCls);&lt;br /&gt;
&lt;br /&gt;
//slot to customize&lt;br /&gt;
Slot testSlot = kb.getSlot(&amp;quot;other_information&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
SlotWidget sw = formWidget.getSlotWidget(testSlot);&lt;br /&gt;
&lt;br /&gt;
formWidget.replaceWidget(testSlot, &amp;quot;edu.stanford.smi.protege.widget.TextFieldWidget&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//optional - set the label of the slot widget		&lt;br /&gt;
sw.setLabel(&amp;quot;MyLabel&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
//inform the UI that the class form has been customized&lt;br /&gt;
formWidget.getDescriptor().setDirectlyCustomizedByUser(true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Hiding a slot widget from the class display ===&lt;br /&gt;
&lt;br /&gt;
Hiding a slot widget is done by replacing the slot widget with null. So, in the code from above the line containing the &amp;lt;code&amp;gt;replaceWidget&amp;lt;/code&amp;gt; call should be replaced with the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
formWidget.replaceWidget(testSlot, null);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>TaniaTudorache</name></author>	</entry>

	</feed>