|
From: <de...@us...> - 2013-09-13 09:40:26
|
Revision: 8501
http://sourceforge.net/p/fudaa/svn/8501
Author: deniger
Date: 2013-09-13 09:40:23 +0000 (Fri, 13 Sep 2013)
Log Message:
-----------
corrections minor bugs
Modified Paths:
--------------
trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/find/EbliFindDialog.java
Modified: trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/find/EbliFindDialog.java
===================================================================
--- trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/find/EbliFindDialog.java 2013-09-13 09:22:47 UTC (rev 8500)
+++ trunk/framework/ebli-common/src/main/java/org/fudaa/ebli/find/EbliFindDialog.java 2013-09-13 09:40:23 UTC (rev 8501)
@@ -62,7 +62,6 @@
super();
this.selectModeModel = selectModeModel;
}
-
BuIcon add_ = BuResource.BU.getToolIcon("ajouter");
BuIcon and_ = EbliResource.EBLI.getToolIcon("selection-and");
BuIcon remove_ = BuResource.BU.getToolIcon("enlever");
@@ -76,23 +75,23 @@
if (_value != null) {
final Integer i = (Integer) _value;
switch (i.intValue()) {
- case EbliSelectionState.ACTION_ADD:
- txt = selectModeModel.isValueSonde() ? ADD_SONDE : ADD;
- ic = add_;
- break;
- case EbliSelectionState.ACTION_DEL:
- txt = DEL;
- ic = remove_;
- break;
- case EbliSelectionState.ACTION_REPLACE:
- txt = selectModeModel.isValueSonde() ? REPLACE_SONDE : REPLACE;
- ic = set_;
- break;
- case EbliSelectionState.ACTION_AND:
- txt = AND;
- ic = and_;
- break;
- default:
+ case EbliSelectionState.ACTION_ADD:
+ txt = selectModeModel.isValueSonde() ? ADD_SONDE : ADD;
+ ic = add_;
+ break;
+ case EbliSelectionState.ACTION_DEL:
+ txt = DEL;
+ ic = remove_;
+ break;
+ case EbliSelectionState.ACTION_REPLACE:
+ txt = selectModeModel.isValueSonde() ? REPLACE_SONDE : REPLACE;
+ ic = set_;
+ break;
+ case EbliSelectionState.ACTION_AND:
+ txt = AND;
+ ic = and_;
+ break;
+ default:
}
setText(txt);
setIcon(ic);
@@ -106,14 +105,13 @@
Integer[] values_;
Integer[] valuesSonde_;
Integer[] valuesNormal_;
-
Integer lastSondeValue = Integer.valueOf(0);
Integer lastNormalValue = Integer.valueOf(0);
public SelectionModeModel() {
- valuesNormal_ = new Integer[] { new Integer(EbliSelectionState.ACTION_REPLACE),
- new Integer(EbliSelectionState.ACTION_ADD), new Integer(EbliSelectionState.ACTION_DEL),
- new Integer(EbliSelectionState.ACTION_AND) };
+ valuesNormal_ = new Integer[]{new Integer(EbliSelectionState.ACTION_REPLACE),
+ new Integer(EbliSelectionState.ACTION_ADD), new Integer(EbliSelectionState.ACTION_DEL),
+ new Integer(EbliSelectionState.ACTION_AND)};
values_ = valuesNormal_;
selected_ = values_[0];
}
@@ -126,8 +124,8 @@
if (b && values_ != valuesSonde_) {
lastNormalValue = (Integer) getSelectedItem();
if (valuesSonde_ == null) {
- valuesSonde_ = new Integer[] { new Integer(EbliSelectionState.ACTION_REPLACE),
- new Integer(EbliSelectionState.ACTION_ADD) };
+ valuesSonde_ = new Integer[]{new Integer(EbliSelectionState.ACTION_REPLACE),
+ new Integer(EbliSelectionState.ACTION_ADD)};
}
values_ = valuesSonde_;
fireIntervalRemoved(this, valuesSonde_.length, valuesNormal_.length - 1);
@@ -165,19 +163,15 @@
public final static boolean isCalqueFindable(final Object _findable) {
return (_findable instanceof EbliFindableItem) && ((EbliFindableItem) _findable).getFinder() != null;
}
-
JComponent active_;
-
BuButton btSearch_;
JCheckBox cbEdit_;
SelectionModeModel cbMode_;
JComboBox cbSelectMode_;
ComboBoxModel cbSelectModeModel_;
JCheckBox cbZoom_;
-
EbliFindActionInterface currentAct_;
CtuluEnhancedDialog dial_;
-
KeyListener enterListener_;
EbliFindComponent findCmp_;
BuPanel pnCenter_;
@@ -221,14 +215,14 @@
cbSelectMode_.setRenderer(new SelectComboboxRenderer(cbMode_));
pnCenter_.add(cbSelectMode_);
cbSelectMode_.addItemListener(new ItemListener() {
-
public void itemStateChanged(final ItemEvent _e) {
if (currentAct_ != null && _e.getStateChange() == ItemEvent.SELECTED) {
afficheInutileTest();
}
}
});
- lbResults_ = new BuLabel(CtuluLibString.ESPACE);
+ lbResults_ = new BuLabel("R\xE9sultat recherche");
+ lbResults_.setMinimumSize(new Dimension(30, 15));
lbResults_.setHorizontalTextPosition(SwingConstants.CENTER);
lbResults_.setHorizontalAlignment(SwingConstants.CENTER);
pnCenter_.add(lbResults_);
@@ -313,9 +307,9 @@
protected KeyListener getEnterAction() {
if (enterListener_ == null) {
enterListener_ = new KeyListener() {
+ public void keyPressed(final KeyEvent _e) {
+ }
- public void keyPressed(final KeyEvent _e) {}
-
public void keyReleased(final KeyEvent _e) {
if (_e.getKeyCode() == KeyEvent.VK_ENTER) {
find();
@@ -323,7 +317,6 @@
}
public void keyTyped(final KeyEvent _e) {
-
}
};
}
@@ -350,7 +343,6 @@
public void affiche(final Component _parent) {
if (dial_ == null) {
dial_ = new CtuluEnhancedDialog(CtuluLibSwing.getFrameAncestorHelper(_parent)) {
-
@Override
public void cancel() {
setVisible(false);
@@ -369,9 +361,10 @@
}
dial_.setTitle(BuResource.BU.getString("Rechercher"));
dial_.setName("mvFindDialog");
+ clearResult();
dial_.pack();
}
-
+ clearResult();
final Dimension dialogSize = dial_.getSize();
final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
dial_.setLocation((screenSize.width - dialogSize.width) / 2, (screenSize.height - dialogSize.height) / 2);
@@ -390,17 +383,22 @@
}
protected void clearResult() {
- lbResults_.setText(CtuluLibString.EMPTY_STRING);
+ lbResults_.setText(CtuluLibString.ESPACE);
}
protected void setResultText(final String _s) {
lbResults_.setForeground(CtuluLibSwing.getDefaultLabelForegroundColor());
lbResults_.setText(_s);
+ if (dial_ != null) {
+ dial_.pack();
+ }
}
public void find() {
clearResult();
- if (currentAct_ == null) { return; }
+ if (currentAct_ == null) {
+ return;
+ }
if (!"SONDE".equals(findCmp_.getSearchId()) && isInutileSearch()) {
afficheInutileTest();
return;
@@ -408,7 +406,7 @@
final String err = currentAct_.erreur(findCmp_.getFindQuery(), findCmp_.getSearchId(), visu_);
visu_.setSelected((EbliFindableItem) cbSelectModeModel_.getSelectedItem());
if (currentAct_.find(findCmp_.getFindQuery(), findCmp_.getSearchId(), ((Integer) cbMode_.getSelectedItem())
- .intValue(), visu_)) {
+ .intValue(), visu_)) {
if (err != null) {
setErrorText(BuResource.BU.getString("Avertissement:") + CtuluLibString.ESPACE + err);
}
@@ -440,7 +438,7 @@
public boolean isInutileSearch() {
final int i = ((Integer) cbMode_.getSelectedItem()).intValue();
return (i == EbliSelectionState.ACTION_AND || i == EbliSelectionState.ACTION_DEL)
- && (currentAct_.getCalque()).isSelectionEmpty();
+ && (currentAct_.getCalque()).isSelectionEmpty();
}
public void itemStateChanged(final ItemEvent _evt) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|