mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[microba] IJPL-157402 Remove unused classes
GitOrigin-RevId: fff73b5e9437c6dca9894d50c878b7b4158ac2fc
This commit is contained in:
committed by
intellij-monorepo-bot
parent
bf6aa34893
commit
c788902ef7
@@ -8,7 +8,7 @@ Features
|
||||
---------
|
||||
CalendarPane
|
||||
DatePicker
|
||||
DatePickerCellEditor
|
||||
|
||||
* Locale aware
|
||||
* TimeZone aware
|
||||
* Supports null date (nullable)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
package com.michaelbaranov.microba.calendar;
|
||||
|
||||
import com.michaelbaranov.microba.calendar.ui.DatePickerUI;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.tree.TreeCellEditor;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* This class in a concrete implementation of {@link TableCellEditor} and
|
||||
* {@link TreeCellEditor} interfaces. Uses {@link DatePicker} control as en
|
||||
* editor. Subclass to extend functionality. *
|
||||
* <p>
|
||||
* Note: you probably will want to set the property of the {@link DatePicker}
|
||||
* {@value DatePicker#PROPERTY_NAME_DROPDOWN_FOCUSABLE} to <code>false</code>
|
||||
* before using it to construct {@link DatePickerCellEditor}.
|
||||
*
|
||||
* @see DefaultCellEditor
|
||||
*
|
||||
* @author Michael Baranov
|
||||
*
|
||||
*/
|
||||
public class DatePickerCellEditor extends DefaultCellEditor {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* <p>
|
||||
* Note: you probably will want to set the property of the
|
||||
* {@link DatePicker} {@value DatePicker#PROPERTY_NAME_DROPDOWN_FOCUSABLE}
|
||||
* to <code>false</code> before using it to construct
|
||||
* {@link DatePickerCellEditor}.
|
||||
*
|
||||
* @param datePicker
|
||||
* the editor component
|
||||
*/
|
||||
public DatePickerCellEditor(final DatePicker datePicker) {
|
||||
// trick: supply a dummy JCheckBox
|
||||
super(new JCheckBox());
|
||||
// get back the dummy JCheckBox
|
||||
JCheckBox checkBox = (JCheckBox) this.editorComponent;
|
||||
// remove listeners installed by super()
|
||||
checkBox.removeActionListener(this.delegate);
|
||||
// replace editor component with own
|
||||
this.editorComponent = datePicker;
|
||||
|
||||
// set simple look
|
||||
((DatePickerUI) datePicker.getUI()).setSimpeLook(true);
|
||||
|
||||
// replace delegate with own
|
||||
this.delegate = new EditorDelegate() {
|
||||
@Override
|
||||
public void setValue(Object value) {
|
||||
try {
|
||||
((DatePicker) editorComponent).setDate((Date) value);
|
||||
} catch (PropertyVetoException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCellEditorValue() {
|
||||
return ((DatePicker) editorComponent).getDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelCellEditing() {
|
||||
((DatePicker) editorComponent).commitOrRevert();
|
||||
super.cancelCellEditing();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopCellEditing() {
|
||||
((DatePicker) editorComponent).commitOrRevert();
|
||||
return super.stopCellEditing();
|
||||
}
|
||||
|
||||
};
|
||||
// install listeners
|
||||
datePicker.addActionListener(delegate);
|
||||
// do not set it to 1
|
||||
setClickCountToStart(2);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.michaelbaranov.microba.common;
|
||||
|
||||
import javax.swing.event.EventListenerList;
|
||||
|
||||
|
||||
/**
|
||||
* This is a convenience implementation of {@link Policy}.
|
||||
*
|
||||
* @author Michael Baranov
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractPolicy implements Policy {
|
||||
private final EventListenerList vetoPolicyListenerList = new EventListenerList();
|
||||
|
||||
@Override
|
||||
public void addVetoPolicyListener(PolicyListener listener) {
|
||||
vetoPolicyListenerList.add(PolicyListener.class, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeVetoPolicyListener(PolicyListener listener) {
|
||||
vetoPolicyListenerList.remove(PolicyListener.class, listener);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires a {@link PolicyEvent} to all related {@link PolicyListener}s.
|
||||
*/
|
||||
protected void fireVetoPolicyChangeAction() {
|
||||
Object[] listeners = vetoPolicyListenerList.getListenerList();
|
||||
|
||||
for (int i = listeners.length - 2; i >= 0; i -= 2)
|
||||
if (listeners[i] == PolicyListener.class)
|
||||
((PolicyListener) listeners[i + 1])
|
||||
.policyChanged(new PolicyEvent(this));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package com.michaelbaranov.microba.gradienteditor.ui;
|
||||
|
||||
import com.michaelbaranov.microba.gradient.GradientBar;
|
||||
import com.michaelbaranov.microba.gradienteditor.GradientEditor;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
|
||||
public class GradientEditorListener implements PropertyChangeListener {
|
||||
|
||||
private GradientEditorUI ui;
|
||||
|
||||
private GradientEditor editor;
|
||||
|
||||
public GradientEditorListener(GradientEditor editor, GradientEditorUI ui) {
|
||||
super();
|
||||
this.editor = editor;
|
||||
this.ui = ui;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void propertyChange(PropertyChangeEvent evt) {
|
||||
if (GradientBar.PROPERTY_DATA_MODEL.equals(evt.getPropertyName())) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user