java.awt.Toolkit.removePropertyChangeListener()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中java.awt.Toolkit.removePropertyChangeListener()方法的一些代码示例,展示了Toolkit.removePropertyChangeListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolkit.removePropertyChangeListener()方法的具体详情如下:
包路径:java.awt.Toolkit
类名称:Toolkit
方法名:removePropertyChangeListener

Toolkit.removePropertyChangeListener介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-explorer

public void removePropertyChangeListener(PropertyChangeListener l) {
  if (this.l == l) {
    Toolkit.getDefaultToolkit().removePropertyChangeListener(
        "win.xpstyle.themeActive",   //NOI18N
        this);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * Invalides the current value so that the next invocation of <code>createValue</code> will ask for the property
 * again.
 */
public void invalidate() {
  if (pcl != null) {
    toolkit.removePropertyChangeListener(getKey(), pcl);
    toolkit = null;
    pcl = null;
    value = null;
  }
}

代码示例来源:origin: EvoSuite/evosuite

public void setFileHidingEnabled(boolean b) {
  // Dump showFilesListener since we'll ignore it from now on
  if (showFilesListener != null) {
    Toolkit.getDefaultToolkit().removePropertyChangeListener(SHOW_HIDDEN_PROP, showFilesListener);
    showFilesListener = null;
  }
  boolean oldValue = useFileHiding;
  useFileHiding = b;
  firePropertyChange(FILE_HIDING_CHANGED_PROPERTY, oldValue, useFileHiding);
}

代码示例来源:origin: EvoSuite/evosuite

public void propertyChange(PropertyChangeEvent ev) {
    assert ev.getPropertyName().equals(SHOW_HIDDEN_PROP);
    MockJFileChooser jfc = jfcRef.get();
    if (jfc == null) {
      // Our JFileChooser is no longer around, so we no longer need to
      // listen for PropertyChangeEvents.
      Toolkit.getDefaultToolkit().removePropertyChangeListener(SHOW_HIDDEN_PROP, this);
    }
    else {
      boolean oldValue = jfc.useFileHiding;
      jfc.useFileHiding = !((Boolean)ev.getNewValue()).booleanValue();
      jfc.firePropertyChange(FILE_HIDING_CHANGED_PROPERTY, oldValue, jfc.useFileHiding);
    }
  }
}

代码示例来源:origin: UISpec4J/UISpec4J

public void removePropertyChangeListener(String name, PropertyChangeListener pcl) {
 getUnderlyingToolkit().removePropertyChangeListener(name, pcl);
}

代码示例来源:origin: org.netbeans.api/org-netbeans-swing-plaf

public void propertyChange (PropertyChangeEvent pce) {
    if (pce.getSource() instanceof UIManager && "lookAndFeel".equals( //NOI18N
      pce.getPropertyName())) { 
        
      String s = UIManager.getLookAndFeel().getClass().getName();
      if (s.indexOf("gtk") < 0) { //NOI18N
        //We have changed look and feels somehow.  Unregister.
        UIManager.removePropertyChangeListener(this);
        Toolkit.getDefaultToolkit().removePropertyChangeListener(
          "gnome.Gtk/FontName", this); //NOI18N
        Toolkit.getDefaultToolkit().removePropertyChangeListener(
          "gnome.Xft/DPI", this); //NOI18N
        Toolkit.getDefaultToolkit().removePropertyChangeListener(
          "gnome.Net/ThemeName", this); //NOI18N
      }
    } else {
      for (ThemeValue tv: instances) {
        tv.clear();
      }
    }
  }
}

代码示例来源:origin: JetBrains/jediterm

public static void removeLeakingAppleListeners() {
  if (!hasLeakingAppleListeners()) return;
  Toolkit toolkit = Toolkit.getDefaultToolkit();
  String name = "apple.awt.contentScaleFactor";
  for (PropertyChangeListener each : toolkit.getPropertyChangeListeners(name)) {
    toolkit.removePropertyChangeListener(name, each);
  }
}

代码示例来源:origin: com.googlecode.vfsjfilechooser2/vfsjfilechooser2

public void propertyChange(PropertyChangeEvent ev)
  {
    assert ev.getPropertyName().equals(SHOW_HIDDEN_PROP);
    VFSJFileChooser jfc = jfcRef.get();
    if (jfc == null)
    {
      // Our VFSJFileChooser is no longer around, so we no longer need to
      // listen for PropertyChangeEvents.
      Toolkit.getDefaultToolkit()
          .removePropertyChangeListener(SHOW_HIDDEN_PROP, this);
    }
    else
    {
      boolean oldValue = jfc.useFileHiding;
      jfc.useFileHiding = !((Boolean) ev.getNewValue()).booleanValue();
      jfc.firePropertyChange(FILE_HIDING_CHANGED_PROPERTY, oldValue,
        jfc.useFileHiding);
    }
  }
}

代码示例来源:origin: com.googlecode.vfsjfilechooser2/vfsjfilechooser2

/**
 * Sets file hiding on or off. If true, hidden files are not shown
 * in the file chooser. The job of determining which files are
 * shown is done by the <code>FileView</code>.
 *
 * @beaninfo
 *   preferred: true
 *       bound: true
 * description: Sets file hiding on or off.
 *
 * @param b the boolean value that determines whether file hiding is
 *          turned on
 * @see #isFileHidingEnabled
 */
public void setFileHidingEnabled(boolean b)
{
  // Dump showFilesListener since we'll ignore it from now on
  if (showFilesListener != null)
  {
    Toolkit.getDefaultToolkit()
        .removePropertyChangeListener(SHOW_HIDDEN_PROP,
      showFilesListener);
    showFilesListener = null;
  }
  boolean oldValue = useFileHiding;
  useFileHiding = b;
  firePropertyChange(FILE_HIDING_CHANGED_PROPERTY, oldValue, useFileHiding);
}

代码示例来源:origin: com.jidesoft/jide-oss

/**
 * Invalides the current value so that the next invocation of <code>createValue</code> will ask for the property
 * again.
 */
public void invalidate() {
  if (pcl != null) {
    for (int i = 0; i < getKeys().length; i++) {
      toolkit.removePropertyChangeListener(getKeys()[i], pcl);
    }
    toolkit = null;
    pcl = null;
    value = null;
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

public void propertyChange(PropertyChangeEvent pce) {
    WindowsDesktopProperty property = (WindowsDesktopProperty) get();
    if (property == null) {
      // The property was GC'ed, we're no longer interested in
      // PropertyChanges, remove the listener.
      kit.removePropertyChangeListener(pce.getPropertyName(), this);
    }
    else {
      property.invalidate();
      property.updateUI();
    }
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

public void propertyChange(PropertyChangeEvent pce) {
    ExtWindowsDesktopProperty property = (ExtWindowsDesktopProperty) get();
    if (property == null) {
      // The property was GC'ed, we're no longer interested in
      // PropertyChanges, remove the listener.
      kit.removePropertyChangeListener(pce.getPropertyName(), this);
    }
    else {
      property.invalidate();
      property.updateUI();
    }
  }
}

相关文章