forked from fanruan/design
vito
9 years ago
6 changed files with 91 additions and 28 deletions
@ -0,0 +1,26 @@
|
||||
package com.fr.design.extra; |
||||
|
||||
import com.fr.design.dialog.BasicPane; |
||||
import com.fr.design.dialog.UIDialog; |
||||
import com.fr.design.utils.gui.GUICoreUtils; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by vito on 16/4/18. |
||||
*/ |
||||
public class ShopDialog extends UIDialog{ |
||||
private static final Dimension DEFAULT_SHOP = new Dimension(900, 760); |
||||
|
||||
public ShopDialog(Frame frame, BasicPane pane) { |
||||
super(frame, pane,false); |
||||
setSize(DEFAULT_SHOP); |
||||
GUICoreUtils.centerWindow(this); |
||||
setResizable(false); |
||||
} |
||||
|
||||
@Override |
||||
public void checkValid() throws Exception { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,46 @@
|
||||
package com.fr.design.extra.exe; |
||||
|
||||
import com.fr.design.extra.PluginWebBridge; |
||||
import com.fr.design.extra.Process; |
||||
import com.fr.general.FRLogger; |
||||
import com.fr.general.http.HttpClient; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
/** |
||||
* Created by vito on 16/4/18. |
||||
*/ |
||||
public class SearchExecutor implements Executor { |
||||
private String result; |
||||
private String keyword; |
||||
|
||||
public SearchExecutor(String keyword) { |
||||
this.keyword = keyword; |
||||
} |
||||
|
||||
@Override |
||||
public String getTaskFinishMessage() { |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public Command[] getCommands() { |
||||
return new Command[]{ |
||||
new Command() { |
||||
@Override |
||||
public String getExecuteMessage() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public void run(Process<String> process) { |
||||
try { |
||||
HttpClient httpClient = new HttpClient(PluginWebBridge.PLUGIN_SHOP + "&keyword=" + keyword); |
||||
result = httpClient.getResponseText(); |
||||
} catch (Exception e) { |
||||
FRLogger.getLogger().error(e.getMessage()); |
||||
} |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
} |
Loading…
Reference in new issue