<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSWT_JFace_Eclipse%2FJFace_Registry</id>
		<title>Java/SWT JFace Eclipse/JFace Registry - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSWT_JFace_Eclipse%2FJFace_Registry"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/JFace_Registry&amp;action=history"/>
		<updated>2026-04-13T09:59:44Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/JFace_Registry&amp;diff=5646&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/JFace_Registry&amp;diff=5646&amp;oldid=prev"/>
				<updated>2010-06-01T05:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 05:55, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/JFace_Registry&amp;diff=5645&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/SWT_JFace_Eclipse/JFace_Registry&amp;diff=5645&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== ImageRegistry Demo ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import org.eclipse.jface.resource.*;&lt;br /&gt;
import org.eclipse.jface.window.ApplicationWindow;&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class tests ImageRegistry&lt;br /&gt;
 */&lt;br /&gt;
public class ImageRegistryTest extends ApplicationWindow {&lt;br /&gt;
  // Keys for the registry&lt;br /&gt;
  private static final String ONE = &amp;quot;one&amp;quot;;&lt;br /&gt;
  private static final String TWO = &amp;quot;two&amp;quot;;&lt;br /&gt;
  private static final String THREE = &amp;quot;three&amp;quot;;&lt;br /&gt;
  /**&lt;br /&gt;
   * ImageRegistryTest constructor&lt;br /&gt;
   */&lt;br /&gt;
  public ImageRegistryTest() {&lt;br /&gt;
    super(null);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Runs the application&lt;br /&gt;
   */&lt;br /&gt;
  public void run() {&lt;br /&gt;
    setBlockOnOpen(true);&lt;br /&gt;
    open();&lt;br /&gt;
    Display.getCurrent().dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates the window&amp;quot;s contents&lt;br /&gt;
   * &lt;br /&gt;
   * @param parent the parent composite&lt;br /&gt;
   * @return Control&lt;br /&gt;
   */&lt;br /&gt;
  protected Control createContents(Composite parent) {&lt;br /&gt;
    Composite composite = new Composite(parent, SWT.NONE);&lt;br /&gt;
    composite.setLayout(new FillLayout());&lt;br /&gt;
    // Put the images in the registry&lt;br /&gt;
    ImageRegistry ir = new ImageRegistry();&lt;br /&gt;
    ir.put(ONE, ImageDescriptor.createFromFile(ImageRegistryTest.class,&lt;br /&gt;
        &amp;quot;jexp.gif&amp;quot;));&lt;br /&gt;
    ir.put(TWO, ImageDescriptor.createFromFile(ImageRegistryTest.class,&lt;br /&gt;
        &amp;quot;jexp.gif&amp;quot;));&lt;br /&gt;
    ir.put(THREE, ImageDescriptor.createFromFile(ImageRegistryTest.class,&lt;br /&gt;
        &amp;quot;jexp.gif&amp;quot;));&lt;br /&gt;
    // Create the labels and add the images&lt;br /&gt;
    Label label = new Label(composite, SWT.NONE);&lt;br /&gt;
    label.setImage(ir.get(ONE));&lt;br /&gt;
    label = new Label(composite, SWT.NONE);&lt;br /&gt;
    label.setImage(ir.get(TWO));&lt;br /&gt;
    label = new Label(composite, SWT.NONE);&lt;br /&gt;
    label.setImage(ir.get(THREE));&lt;br /&gt;
    getShell().pack();&lt;br /&gt;
    return composite;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new ImageRegistryTest().run();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Various JFace registries ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import org.eclipse.jface.resource.*;&lt;br /&gt;
import org.eclipse.jface.util.*;&lt;br /&gt;
import org.eclipse.jface.window.ApplicationWindow;&lt;br /&gt;
import org.eclipse.swt.SWT;&lt;br /&gt;
import org.eclipse.swt.events.*;&lt;br /&gt;
import org.eclipse.swt.graphics.*;&lt;br /&gt;
import org.eclipse.swt.layout.*;&lt;br /&gt;
import org.eclipse.swt.widgets.*;&lt;br /&gt;
/**&lt;br /&gt;
 * This class tests the various JFace registries&lt;br /&gt;
 */&lt;br /&gt;
public class RegistryTest extends ApplicationWindow implements&lt;br /&gt;
    IPropertyChangeListener {&lt;br /&gt;
  // Keys for the registries&lt;br /&gt;
  private static final String FOREGROUND = &amp;quot;foreground&amp;quot;;&lt;br /&gt;
  private static final String BACKGROUND = &amp;quot;background&amp;quot;;&lt;br /&gt;
  private static final String FONT = &amp;quot;font&amp;quot;;&lt;br /&gt;
  // The label to display the colors and fonts&lt;br /&gt;
  private Label label;&lt;br /&gt;
  // The color registry&lt;br /&gt;
  private static ColorRegistry CR;&lt;br /&gt;
  // The font registry&lt;br /&gt;
  private static FontRegistry FR;&lt;br /&gt;
  /**&lt;br /&gt;
   * RegistryTest constructor&lt;br /&gt;
   */&lt;br /&gt;
  public RegistryTest() {&lt;br /&gt;
    super(null);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Runs the application&lt;br /&gt;
   */&lt;br /&gt;
  public void run() {&lt;br /&gt;
    setBlockOnOpen(true);&lt;br /&gt;
    open();&lt;br /&gt;
    Display.getCurrent().dispose();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates the window&amp;quot;s contents&lt;br /&gt;
   * &lt;br /&gt;
   * @param parent the parent composite&lt;br /&gt;
   * @return Control&lt;br /&gt;
   */&lt;br /&gt;
  protected Control createContents(Composite parent) {&lt;br /&gt;
    Composite composite = new Composite(parent, SWT.NONE);&lt;br /&gt;
    composite.setLayout(new FillLayout(SWT.VERTICAL));&lt;br /&gt;
    // Set up the registries&lt;br /&gt;
    CR = new ColorRegistry();&lt;br /&gt;
    CR.addListener(this);&lt;br /&gt;
    FR = new FontRegistry();&lt;br /&gt;
    FR.addListener(this);&lt;br /&gt;
    // Create the label&lt;br /&gt;
    label = new Label(composite, SWT.CENTER);&lt;br /&gt;
    label.setText(&amp;quot;Hello from JFace&amp;quot;);&lt;br /&gt;
    // Create the randomize button&lt;br /&gt;
    Button button = new Button(composite, SWT.PUSH);&lt;br /&gt;
    button.setText(&amp;quot;Randomize&amp;quot;);&lt;br /&gt;
    button.addSelectionListener(new SelectionAdapter() {&lt;br /&gt;
      public void widgetSelected(SelectionEvent event) {&lt;br /&gt;
        CR.put(FOREGROUND, new RGB((int) (Math.random() * 255), (int) (Math&lt;br /&gt;
            .random() * 255), (int) (Math.random() * 255)));&lt;br /&gt;
        CR.put(BACKGROUND, new RGB((int) (Math.random() * 255), (int) (Math&lt;br /&gt;
            .random() * 255), (int) (Math.random() * 255)));&lt;br /&gt;
        FontData fontData = new FontData(&amp;quot;Times New Roman&amp;quot;,&lt;br /&gt;
            (int) (Math.random() * 72), SWT.BOLD);&lt;br /&gt;
        FR.put(FONT, new FontData[] { fontData});&lt;br /&gt;
      }&lt;br /&gt;
    });&lt;br /&gt;
    return composite;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when any property changes&lt;br /&gt;
   * &lt;br /&gt;
   * @param event the event&lt;br /&gt;
   */&lt;br /&gt;
  public void propertyChange(PropertyChangeEvent event) {&lt;br /&gt;
    // Properties have changed; set into label&lt;br /&gt;
    if (CR.hasValueFor(FOREGROUND)) label.setForeground(CR.get(FOREGROUND));&lt;br /&gt;
    if (CR.hasValueFor(BACKGROUND)) label.setBackground(CR.get(BACKGROUND));&lt;br /&gt;
    if (FR.hasValueFor(FONT)) label.setFont(FR.get(FONT));&lt;br /&gt;
    getShell().pack();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The application entry point&lt;br /&gt;
   * &lt;br /&gt;
   * @param args the command line arguments&lt;br /&gt;
   */&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    new RegistryTest().run();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>