The following document contains the results of PMD's CPD 4.2.2.
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 206 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 281 |
}
}
/* (non-Javadoc)
* @see com.jgoodies.swing.AbstractDialog#doCancel()
*/
public void doCancel() {
LOG.debug("Cancel Pressed.");
super.doCancel();
}
/**
* Finds a new disc cover.
*/
public void findCover() {
final File currentDir = new File(this.directory);
JFileChooser chooser = new JFileChooser();
chooser.setApproveButtonText(Resources.getString("label.Select"));
chooser.setDialogTitle(Resources.getString("label.FindCoverImage"));
chooser.setCurrentDirectory(currentDir);
chooser.addChoosableFileFilter(FilterFactory.imageFileFilter());
chooser.setAcceptAllFileFilterUsed(false);
chooser.setFileView(new ImageFileView());
chooser.setAccessory(new ChooserImagePreview(chooser));
chooser.setMultiSelectionEnabled(false);
int returnVal = chooser.showOpenDialog(Application.getDefaultParentFrame());
if (returnVal != JFileChooser.APPROVE_OPTION) {
return;
}
File file = chooser.getSelectedFile();
this.coverImage = file;
updateCoverImage();
}
/**
* Renames all the music files
*/
public void renameFiles() {
LOG.debug("Renaming Files");
updateTable();
MusicTag musicTag = null;
try {
GuiUtil.setBusyCursor(this, true);
// update tags from dialog values
fillTags();
for (int i = 0; i < tags.length; i++) {
musicTag = (MusicTag)tags[i];
if (musicTag.renameFile(this.settings.getFileFormatMusic())) {
LOG.debug("Renamed " + musicTag.getAbsolutePath());
}
}
} catch (Exception ex) {
final String errorMessage = ResourceUtils.getString("messages.ErrorRenamingFile") + ": " + ex.getMessage();
LOG.error(errorMessage, ex);
MessageUtil.showError(this, errorMessage);
} finally {
GuiUtil.setBusyCursor(this, false);
}
updateTable();
}
/**
* If track titles are all messed up and no amazon search found, this will
* attempt to use the filename to construct a valid title.
*/
public void resetFromFilenames() {
LOG.debug("Constructing titles from filenames");
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag)tags[i];
tag.setTitle(tag.extractTitleFromFilename());
}
updateTable();
}
/**
* If track numbers are all screwed up, then loop and make them 1 to N.
*/
public void resetTrackNumbers() {
LOG.debug("Resetting track numbers.");
final int padding = ((tags.length >= 100) ? 3 : 2);
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag)tags[i];
tag.setTrack(String.valueOf(i + 1), padding);
}
updateTable();
}
/**
* Apply title case to all tracks in the disc.
*/
public void titleCase() {
LOG.debug("Title casing all tracks");
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag)tags[i];
tag.setTitle(FileUtil.capitalize(tag.getTitle()));
}
updateTable();
}
/**
* Updates all of the comments at once
*/
public void updateComments() {
LOG.debug("Updating comments");
updateTable();
final String inputValue = StringUtils.defaultIfEmpty(JOptionPane.showInputDialog(Resources.getString("label.Enteracomment")+": "), "");
for (int i = 0; i < tags.length; i++) {
final MusicTag tag = (MusicTag)tags[i];
tag.setComment(inputValue);
}
updateTable();
}
/**
* Perform the web search.
*/
public void webSearch() {
LOG.debug("Web Search");
WebSearchDialog dialog = new WebSearchDialog((Frame)this.getParent(), this.settings);
dialog.setSelectedArtist(artistField.getText());
dialog.setSelectedDisc(discField.getText());
dialog.open();
// if the user did not select anything
if (dialog.hasBeenCanceled()) {
return;
}
if (StringUtils.isNotBlank(dialog.getSelectedArtist())) {
artistField.setText(dialog.getSelectedArtist());
}
if (StringUtils.isNotBlank(dialog.getSelectedDisc())) {
String end = StringUtils.substringAfterLast(discField.getText(), " -");
if (StringUtils.isNotBlank(end)) {
discField.setText(dialog.getSelectedDisc() + " -" + end);
} else {
discField.setText(dialog.getSelectedDisc());
}
}
if (StringUtils.isNotBlank(dialog.getSelectedYear())) { // NOPMD
if ((NumberUtils.isNumber(yearField.getText())) && (NumberUtils.isNumber(dialog.getSelectedYear()))) { // NOPMD
if (Integer.valueOf(dialog.getSelectedYear()).intValue() < Integer.valueOf(yearField.getText()).intValue()) { // NOPMD
yearField.setText(dialog.getSelectedYear());
}
}
}
// if the track counts match exactly then rename tracks too
Collection amazonTracks = dialog.getSelectedTracks();
if (amazonTracks != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Amazon Count = " + amazonTracks.size());
LOG.debug("Tag Count = " + tags.length);
}
if (amazonTracks.size() == tags.length) {
Object[] tracks = amazonTracks.toArray();
for (int i = 0; i < tags.length; i++) {
MusicTag musicTag = (MusicTag)tags[i];
musicTag.setTitle((String)tracks[i]);
}
}
}
// either overwrite the old cover or create a new one
if (dialog.getSelectedImage() != null) {
try {
if (this.coverImage == null) {
LOG.debug(this.directory);
String imageLocation = ImageFactory.saveImageWithFileFormat(dialog.getSelectedImage(),
this.settings.getFileFormatImage(),
FilenameUtils.getFullPath(this.directory),
artistField.getText(),
discField.getText(),
yearField.getText());
this.coverImage = new File(imageLocation);
} else {
ImageFactory.saveImage(dialog.getSelectedImage(), this.coverImage.getAbsolutePath());
}
updateCoverImage();
} catch (IOException ex) {
final String errorMessage = ResourceUtils.getString("messages.ErrorSavingCoverImage");
MessageUtil.showError(this, errorMessage);
LOG.error(errorMessage, ex);
}
}
updateTable();
}
/**
* Builds and answers the dialog's content.
*
* @return the dialog's content with tabbed pane and button bar
*/
protected JComponent buildContent() {
JPanel content = new JPanel(new BorderLayout());
JButton[] buttons = new JButton[2];
JButton button = createApplyButton();
button.setText(Resources.getString("label.Save"));
button.setEnabled(true);
buttonSave = button;
buttonCancel = createCancelButton();
buttonCancel.setText(Resources.getString("label.Cancel"));
buttons[0] = buttonSave;
buttons[1] = buttonCancel;
buttonBar = ButtonBarFactory.buildRightAlignedBar(buttons);
splitPane = buildSplitPane();
content.add(splitPane, BorderLayout.CENTER);
content.add(buttonBar, BorderLayout.SOUTH);
return content;
}
/**
* Builds and returns the dialog's header.
*
* @return the dialog's header component
*/
protected JComponent buildHeader() {
final TrackAddHeaderPanel header = new TrackAddHeaderPanel(this, Resources.getString("label.AddNewTrack"),
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 430 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 505 |
Resources.TRACK_ADD_ICON);
return header;
}
/**
* Builds and returns the dialog's pane.
*
* @return the dialog's pane component
*/
protected JComponent buildMainPanel() {
FormLayout layout = new FormLayout("fill:pref:grow", "p, p, p");
PanelBuilder builder = new PanelBuilder(layout);
builder.setDefaultDialogBorder();
CellConstraints cc = new CellConstraints();
builder.add(buildDiscPanel(), cc.xy(1, 1));
builder.add(buildTagTablePanel(), cc.xy(1, 3));
return builder.getPanel();
}
/**
* Resizes the given component to give it a quadratic aspect ratio.
*
* @param component the component to be resized
*/
protected void resizeHook(JComponent component) {
// Resizer.ONE2ONE.resizeDialogContent(component);
}
/**
* Builds the search criteria panel.
* <p>
* @return the panel used to specify criteria
*/
private JComponent buildDiscPanel() {
FormLayout layout = new FormLayout("right:max(14dlu;pref), 400px, pref, pref, pref, pref ,pref, fill:pref:grow",
"p, 4px, p, 4px, p, 4px, 4px");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.addLabel(Resources.getString("label.artist")+": ", cc.xy(1, 1));
builder.add(artistField, cc.xyw(2, 1, 4));
builder.add(webImagePreview, cc.xywh(7, 1, 1, 7));
builder.add(ComponentFactory.createTitleCaseButton(artistField), cc.xy(6, 1));
builder.addLabel(Resources.getString("label.disc")+": ", cc.xy(1, 3));
builder.add(discField, cc.xyw(2, 3, 4));
builder.add(ComponentFactory.createTitleCaseButton(discField), cc.xy(6, 3));
builder.addLabel(Resources.getString("label.genre")+": ", cc.xy(1, 5));
builder.add(genreField, cc.xy(2, 5));
builder.addLabel(Resources.getString("label.year")+": ", cc.xy(4, 5));
builder.add(yearField, cc.xy(5, 5));
return builder.getPanel();
}
/**
* Builds the <code>Search Criteria</code>, the <code>Results</code>
* and answers them wrapped by a stripped <code>JSplitPane</code>.
*/
private JComponent buildSplitPane() {
splitPane = UIFactory.createStrippedSplitPane(JSplitPane.VERTICAL_SPLIT, buildDiscPanel(), buildTagTablePanel(),
0.25);
splitPane.setBorder(Borders.DIALOG_BORDER);
return splitPane;
}
/**
* Builds the panel with the JTable tags in it.
* <p>
* @return the panel used to display messages
*/
private JComponent buildTagTablePanel() {
// build the table and model
tagTable.setShowGrid(false);
tagTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
tagTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
// Ask to be notified of selection changes.
ListSelectionModel rowSM = tagTable.getSelectionModel();
rowSM.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
// Ignore extra messages.
if (e.getValueIsAdjusting()) {
return;
}
}
});
JComponent resultsPane = UIFactory.createTablePanel(tagTable);
resultsPane.setPreferredSize(new Dimension(300, 275));
// build the form
FormLayout layout = new FormLayout("fill:pref:grow", "p");
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
builder.add(resultsPane, cc.xy(1, 1));
return builder.getPanel();
}
/**
* Fill each tag from the screen.
*/
private void fillTags() {
// loop through and set the disc settings into each tag
for (int i = 0; i < tags.length; i++) {
MusicTag tag = (MusicTag)tags[i];
tag.setArtist(artistField.getText());
tag.setDisc(discField.getText());
tag.setYear(yearField.getText());
tag.setGenre((String)genreField.getSelectedItem());
}
}
/**
* Loads the JTable with data.
*/
private void loadTable() {
if (LOG.isDebugEnabled()) {
LOG.debug("Loading table.");
}
tableModel = new MusicTagTableModel(tags);
RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tableModel);
tagTable.setModel(tableModel);
tagTable.setRowSorter(sorter);
header.autoSizeColumns();
// one click to edit the text cell
((DefaultCellEditor)tagTable.getDefaultEditor(String.class)).setClickCountToStart(1);
tagTable.updateUI();
}
/**
* Updates the cover thumbnail.
*/
private void updateCoverImage() {
if ((this.coverImage != null) && (this.coverImage.exists())) {
webImagePreview.setImage(ImageFactory.getScaledImage(coverImage.getAbsolutePath(), 90, 90).getImage());
}
}
/**
* Closes any cell editors and fires datachanged event.
*/
private void updateTable() {
GuiUtil.stopTableEditing(tagTable);
tableModel.fireTableDataChanged();
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddHeaderPanel.java | 55 |
| com\melloware\jukes\gui\view\dialogs\TrackAddHeaderPanel.java | 55 |
public TrackAddHeaderPanel(TrackAddDialog owner, String title, String description, Icon icon, int height) {
super(true);
this.owner = owner;
this.height = height;
initComponents();
build();
setTitle(title);
setDescription(description);
setIcon(icon);
}
/**
* Returns the description text.
*/
public String getDescription() {
return descriptionArea.getText();
}
/**
* Returns the icon.
*/
public Icon getIcon() {
return iconLabel.getIcon();
}
/**
* Returns the title text.
*/
public String getTitle() {
return titleLabel.getText();
}
/**
* Sets the description text.
*/
public void setDescription(String description) {
descriptionArea.setText(description);
}
/**
* Sets the icon.
*/
public void setIcon(Icon icon) {
if (null == icon) {
iconLabel.setIcon(null);
return;
}
if ((icon.getIconWidth() > 20) || !(icon instanceof ImageIcon)) {
iconLabel.setIcon(icon);
return;
}
Image image = ((ImageIcon)icon).getImage();
int newWidth = 2 * icon.getIconWidth();
int newHeight = 2 * icon.getIconHeight();
image = image.getScaledInstance(newWidth, newHeight, 0);
iconLabel.setIcon(new ImageIcon(image));
}
/**
* Sets the title text.
*/
public void setTitle(String title) {
titleLabel.setText(title);
}
/**
* Builds and answers the panel's bottom component, a separator by default.
*/
protected JComponent buildBottomComponent() {
final ToolBarBuilder toolBar = new ToolBarBuilder("DiscToolBar");
toolBar.addGap(2);
ToolBarButton button = null;
ActionManager.get(Actions.DISC_WEB_ID).setEnabled(true);
ActionManager.get(Actions.DISC_COVER_ID).setEnabled(true);
ActionManager.get(Actions.FILE_RENAME_ID).setEnabled(true);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_WEB_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_COVER_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.FILE_RENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_TITLECASE_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_RESET_FROM_FILENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_RESET_NUMBERS_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DISC_ADD_COMMENTS_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this.owner);
toolBar.add(button);
final JToolBar bar = toolBar.getToolBar();
bar.setOpaque(false);
return bar;
}
/**
* Builds and answers the panel's center component.
*/
protected JComponent buildCenterComponent() {
FormLayout fl = new FormLayout("7dlu, 9dlu, left:pref, 14dlu:grow, pref, 4dlu",
"7dlu, pref, 2dlu, pref, 0:grow");
JPanel panel = new JPanel(fl);
Dimension size = new Dimension(300, height);
panel.setMinimumSize(size);
panel.setPreferredSize(size);
panel.setOpaque(false);
CellConstraints cc = new CellConstraints();
panel.add(titleLabel, cc.xywh(2, 2, 2, 1));
panel.add(descriptionArea, cc.xy(3, 4));
panel.add(iconLabel, cc.xywh(5, 1, 1, 5));
return panel;
}
/**
* Builds the panel.
*/
private void build() {
FormLayout fl = new FormLayout("pref:grow", "pref, pref");
setLayout(fl);
CellConstraints cc = new CellConstraints();
add(buildCenterComponent(), cc.xy(1, 1));
add(buildBottomComponent(), cc.xy(1, 2));
}
/**
* Creates and configures the UI components.
*/
private void initComponents() {
titleLabel = UIFactory.createBoldLabel("", 0, Color.black);
descriptionArea = UIFactory.createMultilineLabel("");
descriptionArea.setForeground(Color.black);
iconLabel = new JLabel();
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\tool\logging\AwtLogHandler.java | 135 |
| com\melloware\jukes\gui\tool\logging\Log4jFeedbackAppender.java | 99 |
} else if (Level.WARN.equals(level)) {
return "warn";
} else {
return "Message";
}
}
private Frame owner() {
Frame frame = Application.getDefaultParentFrame();
return (frame == null) ? new Frame() : frame;
}
private void sendFeedback(Level level, String msg, Throwable thrown) {
StringWriter out = new StringWriter();
out.write(msg);
out.write("\n");
writeSystemProperties(out,
new String[] {
"os.name", "os.version", "java.vm.vendor", "java.vm.version",
"application.fullversion"
});
if (thrown != null) {
out.write("\n\n");
thrown.printStackTrace(new PrintWriter(out));
}
new SendFeedbackDialog(owner(), "info@melloware.com", getSubject(level), out.toString()).open();
}
private void showOptionWithFeedbackDialog(Level level, String msg, Throwable thrown) {
int messageType = getMessageType(level);
String title = getTitle(level);
String fullMessage = msg + "\n" + thrown.getLocalizedMessage();
int choice = JOptionPane.showOptionDialog(owner(), fullMessage, title, -1, messageType, null, OPTIONS,
OK_LABEL);
if (choice == 1) {
sendFeedback(level, msg, thrown);
}
}
private void writeSystemProperties(StringWriter out, String[] keys) {
for (int i = 0; i < keys.length; i++) {
String key = keys[i];
String value = System.getProperty(key);
if (value != null) {
out.write("\n");
out.write(key);
out.write("=");
out.write(value);
}
}
}
}
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\DiscAddDialog.java | 106 |
| com\melloware\jukes\gui\view\dialogs\TrackAddDialog.java | 115 |
LOG.debug("Track Add Dialog created.");
try {
this.settings = settings;
final MusicTag musicTag = TagFactory.getTag(aFile);
if (LOG.isDebugEnabled()) {
LOG.debug(musicTag.getHeaderInfo());
}
artistField = new JTextField(musicTag.getArtist());
artistField.setColumns(45);
discField = new JTextField(musicTag.getDisc());
discField.setColumns(45);
genreField = new JComboBox(MusicTag.getGenreTypes().toArray());
genreField.setSelectedItem(musicTag.getGenre());
if (genreField.getSelectedItem() == null) {
genreField.setSelectedItem("Other");
}
yearField = new JTextField(musicTag.getYear());
((JTextField)yearField).setColumns(5);
tagTable = new JTable();
header = new EnhancedTableHeader(tagTable.getColumnModel(), tagTable);
tagTable.setTableHeader(header);
// try and get the best image from the directory
directory = FilenameUtils.getFullPath(aFile.getAbsolutePath());
webImagePreview = new AlbumImage();
final File dir = new File(directory);
coverImage = MusicDirectory.findLargestImageFile(dir);
updateCoverImage();
// load table
final Collection files = MusicDirectory.findMusicFiles(dir);
final ArrayList musicTags = new ArrayList();
if ((StringUtils.equals(TRACK_00, musicTag.getTrack())) || (StringUtils.equals(TRACK_32, musicTag.getTrack()))) {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\DisclistPanel.java | 402 |
| com\melloware\jukes\gui\view\PlaylistPanel.java | 504 |
duration = UIFactory.createBoldLabel("");
bitrate = UIFactory.createBoldLabel("");
albumImage = new AlbumImage(new Dimension(170, 170));
ActionListener actionListener = new ActionListener() {
public void actionPerformed(ActionEvent event) {
AlbumImage preview = (AlbumImage) event.getSource();
if (preview.getDisc() != null) {
GuiUtil.setBusyCursor(mainFrame, true);
mainFrame.getMainModule().selectNodeInTree(preview.getDisc());
GuiUtil.setBusyCursor(mainFrame, false);
}
}
};
albumImage.addActionListener(actionListener);
builder.addLabel(ResourceUtils.getString("label.artist") + ": ", cc.xy(1, 2));
builder.add(artist, cc.xyw(2, 2, 3));
builder.add(albumImage, cc.xywh(5, 2, 1, 11));
builder.addLabel(ResourceUtils.getString("label.disc") + ": ", cc.xy(1, 4));
builder.add(disc, cc.xyw(2, 4, 3));
builder.addLabel(ResourceUtils.getString("label.track") + ": ", cc.xy(1, 6));
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\tool\MainController.java | 844 |
| com\melloware\jukes\gui\tool\MainController.java | 1291 |
for (int i = tree.getSelectionPaths().length - 1; i >= 0; i--) {
final TreePath path = tree.getSelectionPaths()[i];
if (path.getLastPathComponent() instanceof AbstractTreeNode) {
final AbstractTreeNode node = (AbstractTreeNode) path.getLastPathComponent();
//AZ look for filtered discs
if (node instanceof ArtistNode) {
final int nodeCount = node.getChildCount();
if (nodeCount > 0) {
for (int ii = 0; ii < node.getChildCount(); ii++) {
final AbstractTreeNode childNode = (AbstractTreeNode) node.getChildAt(ii);
playlist.addNext(childNode.getModel());
}
}
} else {
playlist.addNext(node.getModel());
}
}
}
}
if (editor instanceof JList) {
final JList list = (JList) editor;
final Object[] selections = list.getSelectedValues();
for (int i = selections.length - 1; i >= 0; i--) {
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\dialogs\SearchDialog.java | 322 |
| com\melloware\jukes\gui\view\dialogs\WebSearchDialog.java | 341 |
FormLayout layout = new FormLayout("right:max(14dlu;pref), fill:pref:grow", "4px, p, 4px, p, 4px, p, 4px");
layout.setRowGroups(new int[][] {
{ 2, 4 }
});
PanelBuilder builder = new PanelBuilder(layout);
CellConstraints cc = new CellConstraints();
JButton[] buttons = new JButton[2];
// Create an action with an icon
Action search = new AbstractAction(Resources.getString("label.Search"), Resources.THREAD_START_ICON) {
// This method is called when the button is pressed
public void actionPerformed(ActionEvent evt) {
doSearch();
}
};
buttonSearch = new JButton(search);
// Create an action with an icon
Action stop = new AbstractAction(Resources.getString("label.Stop"), Resources.THREAD_STOP_ICON) {
// This method is called when the button is pressed
public void actionPerformed(ActionEvent evt) {
doStop();
}
};
buttonStop = new JButton(stop);
buttonStop.setEnabled(false);
buttons[0] = buttonSearch;
buttons[1] = buttonStop;
JPanel searchButtonBar = ButtonBarFactory.buildCenteredBar(buttons);
builder.addLabel(Resources.getString("label.artist") +": ", cc.xy(1, 2));
| |
| File | Line |
|---|---|
| com\melloware\jukes\gui\view\editor\DiscEditor.java | 623 |
| com\melloware\jukes\gui\view\editor\TrackEditor.java | 465 |
final ToolBarBuilder bar = new ToolBarBuilder("Track Toolbar");
ToolBarButton button = null;
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.UNLOCK_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.COMMIT_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.ROLLBACK_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.DELETE_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
button = (ToolBarButton)ComponentFactory.createToolBarButton(Actions.FILE_RENAME_ID);
button.putClientProperty(Resources.EDITOR_COMPONENT, this);
bar.add(button);
| |