当前位置: 首页>>代码示例>>Java>>正文


Java DataEntryPanelBuilder类代码示例

本文整理汇总了Java中ca.sqlpower.swingui.DataEntryPanelBuilder的典型用法代码示例。如果您正苦于以下问题:Java DataEntryPanelBuilder类的具体用法?Java DataEntryPanelBuilder怎么用?Java DataEntryPanelBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataEntryPanelBuilder类属于ca.sqlpower.swingui包,在下文中一共展示了DataEntryPanelBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	
	VariablesPanel vp = 
		new VariablesPanel(
				this.variablesHelper,
				this.callback,
				this.defaultVarKey);
	
	JDialog dialog = 
		DataEntryPanelBuilder.createDataEntryPanelDialog(
			vp,
	        this.dialogOwner, 
	        this.windowTitle, 
	        "Insert");
	
	dialog.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:18,代码来源:InsertVariableAction.java

示例2: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	final DataEntryPanel renamePanel = createRenamePanel();
	Callable<Boolean> okCall = new Callable<Boolean>() {
		public Boolean call() {
			renamePanel.applyChanges();
			return Boolean.TRUE;
		}
	};
	
	Callable<Boolean> cancelCall = new Callable<Boolean>() {
		public Boolean call() {
			return Boolean.TRUE;
		}
	};
	JDialog dialog = DataEntryPanelBuilder.createDataEntryPanelDialog(
               renamePanel, dialogParent, "Rename workspace", "OK",
               okCall, cancelCall);
	dialog.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:20,代码来源:RenameWabitServerWorkspaceAction.java

示例3: DataSourceTypeEditorPanel

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
/**
   * Creates a multi-tabbed panel with facilities for configuring all the
   * database types defined in a particular data source collection.
   * 
   * @param collection
   *            The data source collection to edit.
   * @param serverBaseURI
   *            The base URI to the server the JDBC driver JAR files may be
   *            stored on. If the data source collection doesn't refer to any
   *            JAR files on a server, this URI may be specified as null.
   * @param owner The Window that should own any dialogs created within the editor GUI.
   * @see DataSourceTypeEditor
   * @see DefaultDataSourceTypeDialogFactory
   */
  public DataSourceTypeEditorPanel(final DataSourceCollection collection, final Window owner) {
  	jdbcPanel = new JDBCDriverPanel(collection.getServerBaseURI());
  	
  	jdbcPanel.addDriverTreeSelectionListener(new TreeSelectionListener() {
	public void valueChanged(TreeSelectionEvent e) {
		if (e.getNewLeadSelectionPath() != null && e.getNewLeadSelectionPath().getPathCount() > JDBCDriverPanel.DRIVER_LEVEL) {
			driverClass.setText(e.getNewLeadSelectionPath().getLastPathComponent().toString());
		}
	}
});
  	
  	copyPropertiesButton = new JButton(new AbstractAction("Copy Properties...") {
	public void actionPerformed(ActionEvent e) {
		final DataSourceTypeCopyPropertiesPanel copyPropertiesPanel = new DataSourceTypeCopyPropertiesPanel(dsType, collection);
		final JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
				copyPropertiesPanel,
				owner,
				"Copy Properties",
				DataEntryPanelBuilder.OK_BUTTON_LABEL);		

		d.pack();
		d.setLocationRelativeTo(owner);
		d.setVisible(true);
		d.addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosed(WindowEvent e) {
				editDsType(dsType);
			}
		});
	}
  	});
  	
      buildPanel();
      editDsType(null);
  }
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:50,代码来源:DataSourceTypeEditorPanel.java

示例4: createDataSourceDialog

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
/**
 * Helper method that takes a {@link DataEntryPanel} for editing a specific
 * type of {@link SPDataSource} and returns a dialog containing the panel.
 * 
 * @param parentWindow
 *            The parent of the dialog returned.
 * @param onAccept
 *            An action that can be placed on the accept/OK button.
 * @param dataSourcePanel
 *            The {@link DataEntryPanel} for editing an {@link SPDataSource}
 *            .
 */
private JDialog createDataSourceDialog(Window parentWindow,
        final Runnable onAccept, final DataEntryPanel dataSourcePanel) {
    Callable<Boolean> okCall = new Callable<Boolean>() {
        public Boolean call() {
            if (dataSourcePanel.applyChanges()) {
                if (onAccept != null) {
                    onAccept.run();
                }
                return Boolean.TRUE;
            }
            return Boolean.FALSE;
        }
    };

    Callable<Boolean> cancelCall = new Callable<Boolean>() {
        public Boolean call() {
        	dataSourcePanel.discardChanges();
            return Boolean.TRUE;
        }
    };
    
    JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
            dataSourcePanel, parentWindow, "Data Source Properties", "OK", okCall, cancelCall);
    d.pack();
    d.setLocationRelativeTo(parentWindow);
    d.setVisible(true);
    return d;
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:41,代码来源:DefaultDataSourceDialogFactory.java

示例5: PopupMenuMouseListener

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public PopupMenuMouseListener() {
	menu = new JPopupMenu();
	menu.add(new AbstractAction("Change Font Size..") {
		public void actionPerformed(ActionEvent arg0) {
			final FontSelector fontSelector = new FontSelector(getFont());
			Callable<Boolean> okCall = new Callable<Boolean>() {
			    public Boolean call() {
					setFont(fontSelector.getSelectedFont());
					TableUtils.fitColumnWidths(FancyExportableJTable.this, 15);
					
					FontRenderContext frc = ((Graphics2D) getGraphics()).getFontRenderContext();
					Rectangle2D fontBounds = fontSelector.getSelectedFont().getMaxCharBounds(frc);
					setRowHeight((int) fontBounds.getHeight());
					
					return true;
				}
			};
			Callable<Boolean> cancelCall = new Callable<Boolean>() {
			    public Boolean call() throws Exception {
			        return true;
			    }
			};
			JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
			        fontSelector,
			        getTopLevelAncestor(),
			        "Choose a font",
			        "OK",
			        okCall,
			        cancelCall);
			d.setVisible(true);
		}
	});
	menu.add(exportHTMLAction);
	
	menu.add(exportCSVAction);
	menu.pack();
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:38,代码来源:FancyExportableJTable.java

示例6: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	SQLTable sourceTable = (SQLTable)sourceChooser.getTableComboBox().getSelectedItem();
	if (sourceTable == null) {
		JOptionPane.showMessageDialog(panel,
				"You have to select a source table and save before picking columns" );
		return;
	}
	try {
		for(SQLColumn c : sourceTable.getColumns()) {
			c.setType(swingSession.getSQLType(c.getType()));
		}
	} catch (SQLObjectException evt) {
		throw new RuntimeException(evt);
	}
	try {
		MatchMakerIndexBuilder indexBuilder = new MatchMakerIndexBuilder(sourceTable, (MutableComboBoxModel)indexComboBox.getModel(),swingSession);
		JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
				indexBuilder,
				getParentWindow(),
				"Choose the index",
				"OK");
		d.pack();
		d.setLocationRelativeTo(swingSession.getFrame());
		d.setVisible(true);
		
	} catch (Exception ex) {
		ex.printStackTrace();
		SPSUtils.showExceptionDialogNoReport(panel, "An exception occured while picking columns", ex);
	}
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:31,代码来源:ProjectEditor.java

示例7: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	NewTableMergeRuleChooserPane chooserPane = new NewTableMergeRuleChooserPane(swingSession, parent);
	JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
			chooserPane, 
			swingSession.getFrame(), 
			"Choose the table and index for the new merge rule", 
			"OK");
       d.pack();
	d.setLocationRelativeTo(swingSession.getFrame());
       d.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:12,代码来源:NewMergeRuleAction.java

示例8: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
          JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
                  new UserPreferencesEditor((SwingSessionContext) getContext()),
                  frame, "User Preferences", "OK");
          d.setLocationRelativeTo(frame);
          d.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:8,代码来源:MatchMakerSwingSession.java

示例9: mouseClicked

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
@Override
public void mouseClicked(PInputEvent event) {
    super.mouseClicked(event);
    if (event.getClickCount() == 2) {
        if (contentBox.getContentRenderer() == null) {
            WabitLabel newLabel = new WabitLabel();
            contentBox.setContentRenderer(newLabel);
            setSwingContentRenderer(newLabel);
        }
        
        DataEntryPanel propertiesPanel = getPropertiesPanel();
        if (propertiesPanel != null) {
            String propertiesPanelName = "Properties for " + contentBox.getName();
            JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
                    propertiesPanel, dialogOwner, propertiesPanelName, "OK");
            d.setVisible(true);
        }
    } else if (event.getClickCount() == 1) {
    	
    	// Handle clicks on the "parameters" gray box
    	if (
    			contentBox.getContentRenderer() != null &&
        		contentBox.getContentRenderer() instanceof ContextAware && 
    			event.getPosition().getY()-ContentBoxNode.this.getY() >= contentBox.getHeight()-PARAMETER_BANNER_HEIGHT &&
    			event.getPosition().getY()-ContentBoxNode.this.getY() <= contentBox.getHeight()) {
    		
    		displaySelectorsDialog();
    	}
    }
    
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:32,代码来源:ContentBoxNode.java

示例10: showAddOrEditDialog

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
/**
 * Shows a dialog for adding a new server info, or editing an existing one.
 * 
 * @param serverInfo
 *            The server info to edit. If the intent is to add a new one,
 *            specify null.
 */
private void showAddOrEditDialog(final SPServerInfo serverInfo) {
    
    final ServerInfoPanel infoPanel;
    if (serverInfo == null) {
        infoPanel = new ServerInfoPanel(panel);
    } else {
        infoPanel = new ServerInfoPanel(panel, serverInfo);
    }

    Callable<Boolean> okCall = new Callable<Boolean>() {
        public Boolean call() throws Exception {
        	if (!infoPanel.applyChanges()) {
        		return false;
        	}
            if (serverInfo != null) {
                context.removeServer(serverInfo);
            }
            context.addServer(infoPanel.getServerInfo());
            refreshInfoList();
            return true;
        }
    };
    Callable<Boolean> cancelCall = new Callable<Boolean>() {
        public Boolean call() throws Exception {
            return true;
        }
    };

    JDialog dialog = DataEntryPanelBuilder.createDataEntryPanelDialog(
            infoPanel, dialogOwner, "Server Connection Properties", "OK",
            okCall, cancelCall);

    dialog.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:42,代码来源:ServerInfoManager.java

示例11: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	GrantPanel panel = new GrantPanel(this.workspace, this.systemWorkspace, objectType, objectUuid, label);
	DataEntryPanelBuilder.createDataEntryPanelDialog(
			panel,
			((WabitSwingSessionContext)workspace.getSession().getContext()).getFrame(), 
			"Sharing and security - "+label, 
			"Apply changes").setVisible(true);
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:9,代码来源:SecurityAction.java

示例12: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
	
	final DataEntryPanel dep;
	if (selector instanceof ComboBoxSelector) {
		dep = new ComboBoxSelectorPanel(
					dialogOwner,
					selector.getParent(), 
					(ComboBoxSelector)selector);
	} else if (selector instanceof TextBoxSelector) {
		
		dep = new TextBoxSelectorPanel(
				dialogOwner, 
				(TextBoxSelector)selector);
		
	} else if (selector instanceof DateSelector) {
		
		dep = new DateSelectorPanel(
				dialogOwner, 
				(DateSelector)selector);
		
	} else {
		throw new AssertionError();
	}
	
	JDialog dialog = 
		DataEntryPanelBuilder.createDataEntryPanelDialog(
			dep,
	        this.dialogOwner, 
	        "", 
	        "OK");
	
	dialog.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:34,代码来源:EditReportParameterAction.java

示例13: showAddOrEditDialog

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
/**
 * Shows a dialog for adding a new server info, or editing an existing one.
 * 
 * @param serverInfo
 *            The server info to edit. If the intent is to add a new one,
 *            specify null.
 */
private void showAddOrEditDialog(final SPServerInfo serverInfo) {

	final SPServerInfoPanel infoPanel;
	if (serverInfo == null) {
		infoPanel = new SPServerInfoPanel(panel, manager.getClientVersion(), manager.getDefaultSettings());
	} else {
		infoPanel = new SPServerInfoPanel(panel, manager.getClientVersion(), serverInfo);
	}
	
	testAction.addPanel(infoPanel);
	infoPanel.setTestAction(testAction);

	Callable<Boolean> okCall = new Callable<Boolean>() {
		public Boolean call() throws Exception {
			if (!infoPanel.applyChanges()) {
				return false;
			}
			if (serverInfo != null) {
				manager.remove(serverInfo);
			}

			SPServerInfo server = infoPanel.getServerInfo();
			manager.add(server);
			refreshInfoList();
			testAction.removePanel(infoPanel);
			return true;
		}
	};
	Callable<Boolean> cancelCall = new Callable<Boolean>() {
		public Boolean call() throws Exception {
			testAction.removePanel(infoPanel);
			return true;
		}
	};

	JDialog dialog = DataEntryPanelBuilder.createDataEntryPanelDialog(
			infoPanel, dialogOwner, addOrEditDialogLabel, "OK",
			okCall, cancelCall);

	dialog.setVisible(true);
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:49,代码来源:SPServerInfoManagerPanel.java

示例14: showDbcsDialog

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
/**
 * Pops up a dialog box that lets the user inspect and change the given db's
 * connection spec. This is very similar to the showDbcsDialog in the Architect's
 * ASUtils class because it is. Architect has additional tabs for additional data
 * source information (eg Kettle) which is not included in MatchMaker.
 * <p>
 * We considered making some sort of generic API in the library for creating a
 * connection dialog with optional extra tabs, but there's honestly not very
 * much code in this method, and it's hard to justify a whole API for something
 * this lightweight.
 * 
 * @param parentWindow
 *            The window that owns the dialog
 * @param dataSource
 *            the data source to edit (null not allowed)
 * @param onAccept
 *            this runnable will be invoked if the user OKs the dialog and
 *            validation succeeds. If you don't need to do anything in this
 *            situation, just pass in null for this parameter.
 */
public static JDialog showDbcsDialog(
        final Window parentWindow,
        final JDBCDataSource dataSource,
        final Runnable onAccept) {
    
    final DataEntryPanel dbcsPanel = new MMDataSourcePanel(dataSource);
    
    Callable<Boolean> okCall = new Callable<Boolean>() {
        public Boolean call() {
            if (dbcsPanel.applyChanges()) {
                if (onAccept != null) {
                	try {
                		dataSource.getParentCollection().write();
                	} catch (Exception ex) {
                		MMSUtils.showExceptionDialog(parentWindow, "Couldn't save connection information", ex);
                	}
                    onAccept.run();
                }
                return Boolean.TRUE;
            }
            return Boolean.FALSE;
        }
    };

    Callable<Boolean> cancelCall = new Callable<Boolean>() {
        public Boolean call() {
            dbcsPanel.discardChanges();
            return Boolean.TRUE;
        }
    };

    JDialog d = DataEntryPanelBuilder.createDataEntryPanelDialog(
            dbcsPanel, parentWindow,
            "Database Connection: " + dataSource.getDisplayName(),
            DataEntryPanelBuilder.OK_BUTTON_LABEL,
            okCall, cancelCall);

    d.pack();
    d.setLocationRelativeTo(parentWindow);

    d.setVisible(true);
    return d;
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:64,代码来源:MMSUtils.java

示例15: actionPerformed

import ca.sqlpower.swingui.DataEntryPanelBuilder; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {

		String newName = null;
        for (int count = 0;; count++) {
            newName = "Copy" + (count == 0 ? "" : " " + count) + " of " + project.getName();
            if (swingSession.isThisProjectNameAcceptable(newName)) {
                break;
            }
        }
		final JDialog dialog;

		final List<PlFolder> folders = swingSession.getCurrentFolderParent().getChildren(PlFolder.class);
		folderComboBox = new JComboBox(new DefaultComboBoxModel(folders.toArray()));
		folderComboBox.setRenderer(new MatchMakerObjectComboBoxCellRenderer());
		folderComboBox.setSelectedItem(project.getParent());
		
		final DuplicatePanel archPanel = new DuplicatePanel(newName,folderComboBox);

		okCall = new Callable<Boolean>() {
			public Boolean call() {
				String newName = archPanel.getDupName();
				PlFolder folder = (PlFolder) folderComboBox.getSelectedItem();
				
				ByteArrayOutputStream out = new ByteArrayOutputStream();
				ProjectDAOXML outdao = new ProjectDAOXML(out);
				outdao.save(project);
				
				ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
				ProjectDAOXML indao = new ProjectDAOXML(swingSession, in);
				Project newProject = indao.findAll().get(0);
				newProject.setName(newName);
				folder.addChild(newProject);
				return Boolean.TRUE;
			}};
			
		cancelCall = new Callable<Boolean>() {
			public Boolean call() {
				return Boolean.TRUE;
			}};
			
		dialog = DataEntryPanelBuilder.createDataEntryPanelDialog(archPanel,
				swingSession.getFrame(),
				"Duplicate Project",
				"OK",
				okCall,
				cancelCall);
		
		dialog.pack();
		dialog.setLocationRelativeTo(swingSession.getFrame());
		dialog.setVisible(true);
		
		Validator v = new ProjectNameValidator(swingSession,new Project());
        handler.addValidateObject(archPanel.getProjectNameField(),v);
	}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:55,代码来源:DuplicateProjectAction.java


注:本文中的ca.sqlpower.swingui.DataEntryPanelBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。