Here you can find the source of isPasteEnabled(JComponent component)
Parameter | Description |
---|---|
component | the Component to set the enabled state for |
Parameter | Description |
---|---|
NullPointerException | if component is null |
private static boolean isPasteEnabled(JComponent component)
//package com.java2s; /*//from w ww . j a va 2s. c o m * Copyright (C) 2006 Sun Microsystems, Inc. All rights reserved. Use is * subject to license terms. */ import javax.swing.JComponent; public class Main { private static final Object PASTE_CLIENT_PROPERTY = "__paste__"; /** * Returns whether the component can perform a paste operation. * * @param component the Component to set the enabled state for * @throws NullPointerException if component is null */ private static boolean isPasteEnabled(JComponent component) { return getBooleanClientProperty(component, PASTE_CLIENT_PROPERTY); } private static boolean getBooleanClientProperty(JComponent c, Object property) { Boolean value = (Boolean) c.getClientProperty(property); return (value == null) ? false : value; } }