本文整理汇总了Java中javax.swing.JComponent.putClientProperty方法的典型用法代码示例。如果您正苦于以下问题:Java JComponent.putClientProperty方法的具体用法?Java JComponent.putClientProperty怎么用?Java JComponent.putClientProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.putClientProperty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createExtComponent
import javax.swing.JComponent; //导入方法依赖的package包/类
protected JComponent createExtComponent() {
setLineNumberEnabled(true); // enable line numbering
// extComponent will be a panel
JComponent ec = new JPanel(new BorderLayout());
ec.putClientProperty(JTextComponent.class, component);
// Add the scroll-pane with the component to the center
JScrollPane scroller = new JScrollPane(component);
scroller.getViewport().setMinimumSize(new Dimension(4,4));
// remove default scroll-pane border, winsys will handle borders itself
scroller.setBorder(null);
setGlyphGutter(new GlyphGutter(this));
scroller.setRowHeaderView(glyphGutter);
initGlyphCorner(scroller);
ec.add(scroller);
// Install the status-bar panel to the bottom
ec.add(getStatusBar().getPanel(), BorderLayout.SOUTH);
return ec;
}
示例2: initialize
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
this.wiz = wiz;
index = 0;
panels = createPanels();
// Make sure list of steps is accurate.
String[] steps = createSteps();
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName();
}
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Step #.
jc.putClientProperty("WizardPanel_contentSelectedIndex", new Integer(i));
// Step name (actually the whole list for reference).
jc.putClientProperty("WizardPanel_contentData", steps);
}
}
}
示例3: initialize
import javax.swing.JComponent; //导入方法依赖的package包/类
/**
* Initialization of the wizard iterator.
*/
public void initialize(TemplateWizard wizard) {
index = 0;
Project project = Templates.getProject( wizard );
panels = createPanels (project, wizard);
// Creating steps.
Object prop = wizard.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N
String[] beforeSteps = null;
if (prop instanceof String[]) {
beforeSteps = (String[])prop;
}
String[] steps = createSteps (beforeSteps, panels);
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent ();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName ();
}
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Step #.
jc.putClientProperty (WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i)); // NOI18N
// Step name (actually the whole list for reference).
jc.putClientProperty (WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
}
}
}
示例4: initializePanels
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
protected WizardDescriptor.Panel[] initializePanels() {
WizardDescriptor.Panel[] panels = new WizardDescriptor.Panel[3];
repositoryStep = new RepositoryStep(Repository.FLAG_ACCEPT_REVISION, RepositoryStep.CHECKOUT_HELP_ID);
repositoryStep.addChangeListener(CheckoutWizard.this);
checkoutStep = new CheckoutStep();
checkoutStep.addChangeListener(CheckoutWizard.this);
panels = new WizardDescriptor.Panel[] {repositoryStep, checkoutStep};
String[] steps = new String[panels.length];
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
// Default step name to component name of panel. Mainly useful
// for getting the name of the target chooser to appear in the
// list of steps.
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Sets step number of a component
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
// Sets steps names for a panel
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
// Turn on subtitle creation on each step
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
// Show steps on the left side with the image on the background
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
// Turn on numbering of all steps
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
}
}
return panels;
}
示例5: initialize
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public void initialize( WizardDescriptor wd ) {
this.wiz = wd;
importWorker = new ImportWorker(languageToolchain, wiz);
wiz.putProperty(WizardProperty.APPLICATION_TYPE.key(), (Integer) TYPE_APPLICATION);
wiz.setTitleFormat(new MessageFormat("{0}"));
wiz.setTitle( NbBundle.getMessage(ChipKitImportWizardIterator.class, "WizardTitle") );
panels = new WizardDescriptor.Panel[]{
new ProjectSetupStep( arduinoConfig ),
new ProgrammerDebuggerSelectionStep(),
new ProgressTrackingStep( importWorker )
};
String[] steps = new String[panels.length];
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Sets step number of a component
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i); // NOI18N
// Sets steps names for a panel
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
// Turn on subtitle creation on each step
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
// Show steps on the left side with the image on the background
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
// Turn on numbering of all steps
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
}
}
}
示例6: updateStepsList
import javax.swing.JComponent; //导入方法依赖的package包/类
void updateStepsList() {
JComponent component = (JComponent) current().getComponent();
if (component == null) {
return;
}
String[] list;
list = new String[]{
NbBundle.getMessage(PanelConfigureProject.class, "LBL_NWP1_ProjectTitleName"), // NOI18N
};
component.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, list); // NOI18N
component.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(currentIndex)); // NOI18N
}
示例7: initialize
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
this.wiz = wiz;
index = 0;
panels = createPanels();
// Make sure list of steps is accurate.
String[] steps = createSteps();
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName();
}
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent)c;
// Step #.
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
// Step name (actually the whole list for reference).
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
}
}
//set the default values of the sourceRoot and the testRoot properties
this.wiz.putProperty("sourceRoot", new File[0]); //NOI18N
this.wiz.putProperty("testRoot", new File[0]); //NOI18N
}
示例8: setSteps
import javax.swing.JComponent; //导入方法依赖的package包/类
private static void setSteps(WizardDescriptor.Panel[] panels, String[] steps, String[] resultSteps, int offset) {
int n = steps == null ? 0 : steps.length;
for (int i = 0; i < panels.length; i++) {
final JComponent component = (JComponent) panels[i].getComponent();
String step = i < n ? steps[i] : null;
if (step == null) {
step = component.getName();
}
component.putClientProperty(WIZARD_PANEL_CONTENT_DATA, resultSteps);
component.putClientProperty(WIZARD_PANEL_CONTENT_SELECTED_INDEX, Integer.valueOf(i));
component.getAccessibleContext().setAccessibleDescription(step);
resultSteps[i + offset] = step;
}
}
示例9: setDelegateRepaintManager
import javax.swing.JComponent; //导入方法依赖的package包/类
/**
* Registers delegate RepaintManager for {@code JComponent}.
*/
public static void setDelegateRepaintManager(JComponent component,
RepaintManager repaintManager) {
/* setting up flag in AppContext to speed up lookups in case
* there are no delegate RepaintManagers used.
*/
AppContext.getAppContext().put(DELEGATE_REPAINT_MANAGER_KEY,
Boolean.TRUE);
component.putClientProperty(DELEGATE_REPAINT_MANAGER_KEY,
repaintManager);
}
示例10: initPanel
import javax.swing.JComponent; //导入方法依赖的package包/类
void initPanel(JComponent comp, int wizardNumber) {
comp.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
comp.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
comp.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
comp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, // NOI18N
new Integer(wizardNumber));
comp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, new String[] { // NOI18N
WORKSPACE_LOCATION_STEP, PROJECTS_SELECTION_STEP
});
comp.setPreferredSize(new java.awt.Dimension(500, 380));
}
示例11: initializePanels
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel<WizardDescriptor>[] initializePanels () {
selectUriStep = new SelectUriStep(repository, remotes, SelectUriStep.Mode.FETCH);
selectUriStep.addChangeListener(FetchWizard.this);
fetchBranchesStep = new FetchBranchesStep(repository, FetchBranchesStep.Mode.ACCEPT_NON_EMPTY_SELECTION_ONLY);
fetchBranchesStep.addChangeListener(FetchWizard.this);
Panel[] panels = new Panel[] { selectUriStep, fetchBranchesStep };
String[] steps = new String[panels.length];
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
// Default step name to component name of panel. Mainly useful
// for getting the name of the target chooser to appear in the
// list of steps.
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Sets step number of a component
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
// Sets steps names for a panel
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
// Turn on subtitle creation on each step
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
// Show steps on the left side with the image on the background
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
// Turn on numbering of all steps
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
}
}
return panels;
}
示例12: initialize
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
public void initialize(WizardDescriptor wiz) {
panel = getPanel(wiz);
this.wiz = wiz;
// Make sure list of steps is accurate.
String[] beforeSteps = null;
Object prop = wiz.getProperty (WizardDescriptor.PROP_CONTENT_DATA);
if (prop != null && prop instanceof String[]) {
beforeSteps = (String[])prop;
}
String[] steps = createSteps (beforeSteps);
for (int i = 0; i < 1; i++) { // XXX what was this loop for, exactly? panels.length was always 1
Component c = panel.getComponent();
if (steps[i] == null) {
// Default step name to component name of panel.
// Mainly useful for getting the name of the target
// chooser to appear in the list of steps.
steps[i] = c.getName();
}
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent)c;
// Step #.
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i));
// Step name (actually the whole list for reference).
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
}
}
}
示例13: initializePanels
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel<WizardDescriptor>[] initializePanels () {
selectUriStep = new SelectUriStep(repository, remotes, SelectUriStep.Mode.PUSH);
selectUriStep.addChangeListener(PushWizard.this);
pushBranchesStep = new PushBranchesStep(repository);
pushBranchesStep.addChangeListener(PushWizard.this);
updateBranchReferencesStep = new UpdateBranchReferencesStep(repository);
updateBranchReferencesStep.addChangeListener(PushWizard.this);
Panel[] panels = new Panel[] { selectUriStep, pushBranchesStep, updateBranchReferencesStep };
String[] steps = new String[panels.length];
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
// Default step name to component name of panel. Mainly useful
// for getting the name of the target chooser to appear in the
// list of steps.
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Sets step number of a component
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
// Sets steps names for a panel
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
// Turn on subtitle creation on each step
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
// Show steps on the left side with the image on the background
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
// Turn on numbering of all steps
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
}
}
return panels;
}
示例14: initializePanels
import javax.swing.JComponent; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
protected Panel<WizardDescriptor>[] initializePanels () {
selectUriStep = new SelectUriStep(repository, remotes, SelectUriStep.Mode.PULL);
selectUriStep.addChangeListener(PullWizard.this);
pullBranchesStep = new PullBranchesStep(repository);
pullBranchesStep.addChangeListener(PullWizard.this);
Panel[] panels = new Panel[] { selectUriStep, pullBranchesStep };
String[] steps = new String[panels.length];
for (int i = 0; i < panels.length; i++) {
Component c = panels[i].getComponent();
// Default step name to component name of panel. Mainly useful
// for getting the name of the target chooser to appear in the
// list of steps.
steps[i] = c.getName();
if (c instanceof JComponent) { // assume Swing components
JComponent jc = (JComponent) c;
// Sets step number of a component
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N
// Sets steps names for a panel
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N
// Turn on subtitle creation on each step
jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N
// Show steps on the left side with the image on the background
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N
// Turn on numbering of all steps
jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N
}
}
return panels;
}
示例15: show
import javax.swing.JComponent; //导入方法依赖的package包/类
@NbBundle.Messages("LBL_BuildImage=Build Image")
public void show() {
List<WizardDescriptor.Panel<WizardDescriptor>> panels = new ArrayList<>();
if (instance == null) {
panels.add(new BuildInstancePanel());
}
panels.add(new BuildContextPanel(fileSystem));
panels.add(new BuildOptionsPanel());
String[] steps = new String[panels.size()];
for (int i = 0; i < panels.size(); i++) {
JComponent c = (JComponent) panels.get(i).getComponent();
// Default step name to component name of panel.
steps[i] = c.getName();
c.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);
c.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
c.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, true);
c.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, true);
c.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, true);
}
WizardDescriptor wiz = new WizardDescriptor(new WizardDescriptor.ArrayIterator<>(panels));
// {0} will be replaced by WizardDesriptor.Panel.getComponent().getName()
wiz.setTitleFormat(new MessageFormat("{0}"));
wiz.setTitle(Bundle.LBL_BuildImage());
if (instance != null) {
wiz.putProperty(INSTANCE_PROPERTY, instance);
}
if (dockerfile != null && dockerfile.isData()) {
wiz.putProperty(BUILD_CONTEXT_PROPERTY, dockerfile.getParent().getPath());
wiz.putProperty(DOCKERFILE_PROPERTY, dockerfile.getName());
}
wiz.putProperty(FILESYSTEM_PROPERTY, fileSystem);
if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) {
Boolean pull = (Boolean) wiz.getProperty(PULL_PROPERTY);
Boolean noCache = (Boolean) wiz.getProperty(NO_CACHE_PROPERTY);
build((DockerInstance) wiz.getProperty(INSTANCE_PROPERTY),
(String) wiz.getProperty(BUILD_CONTEXT_PROPERTY),
(String) wiz.getProperty(DOCKERFILE_PROPERTY),
(Map<String, String>) wiz.getProperty(BUILD_ARGUMENTS_PROPERTY),
(String) wiz.getProperty(REPOSITORY_PROPERTY),
(String) wiz.getProperty(TAG_PROPERTY),
pull != null ? pull : PULL_DEFAULT,
noCache != null ? noCache : NO_CACHE_DEFAULT);
}
}