Thursday, October 18, 2012

Gmail IME, Gmail加入了输入法

刚在黑板报看见说Gmail有了输入法,像translate一样,到邮件界面看,并没有啊! 再到设置里,翻到底也没有?! 最后发现语言旁边有个更多语言选项,在下面就有启动输入工具,打上勾,编辑一下输入法(选择不少,不过没几样我要的,不像百度可以启动手写输入),最后保存,等页面刷新后,在邮件列表左上角就有个按钮是输入选项了。

Wednesday, March 28, 2012

Prompt TextInput in GWT

Prompt text input is very common and useful widget, but GWT does not have it. I create this one with ability to show prompts at the initial and reset to prompt if the text input text is empty. I should thank David Chandler and Geoffrey Wiseman for their implementation of prompt input. Enhancement of this widget is able to be used in UiBinder, show prompt on Blur and uses styleDependentName instead. Problems of this widget are the "italic" style can not set for the prompt if the font-size is small. The prompt default size is changed, I have not found a solution yet. Is it a bug of GWT InputBox?

Source Code for PromptTextBox.java
package com.robinria.gwt.client.custom.widget;

import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyCodes;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
import com.google.gwt.uibinder.client.UiConstructor;
import com.google.gwt.user.client.ui.TextBox;

/**
 * TextBox with input prompts. Prompts hidden When input receive type, click and
 * focus event. Prompts shown when input receives blur event or on initial.
 * 
 */
public class PromptTextBox extends TextBox implements BlurHandler,
  FocusHandler, ClickHandler, KeyPressHandler {

 private String promptText;
 private String promptStyleDependentName;

 /**
  * Construct a new TextBox with prompt text. When instantiate this using
  * UiBinder, either fill in a field marked with @UiField(provided=true),
  * or have to define the all the arguments in UiBinder file.
  * Important: Set styleName should not be used, use set stylePrimaryName instead.
  * 
  * @param promptText prompt text
  * @param promptStyleDependentName style dependent name for prompt text
  */
 @UiConstructor
 public PromptTextBox(String promptText, String promptStyleDependentName) {
  this.promptText = promptText;
  this.promptStyleDependentName = promptStyleDependentName;
  this.addKeyPressHandler(this);
  this.addFocusHandler(this);
  this.addClickHandler(this);
  this.addBlurHandler(this);
  setPrompts();
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onBlur(BlurEvent event) {
  if (getText().isEmpty()) {
   setPrompts();
  }
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onFocus(FocusEvent event) {
  this.setSelectionRange(0, 0);
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onClick(ClickEvent event) {
  if (promptText.equals(getText())) {
   hidePrompts();
  }
 }

 /**
  * {@inheritDoc}
  */
 @Override
 public void onKeyPress(KeyPressEvent event) {
  if (promptText.equals(getText())
    && !(event.getNativeEvent().getKeyCode() == KeyCodes.KEY_TAB)) {
   removePrompts();
  }
 }

 private void setPrompts() {
  this.addStyleDependentName(promptStyleDependentName);
  this.setText(promptText);
 }

 private void removePrompts() {
  this.removeStyleDependentName(promptStyleDependentName);
  this.setText(null);
 }
}
You need to style your prompt input box.
.promptTextBoxStyle {
 overflow: hidden;
}

.promptTextBoxStyle-promptStyle {
 color: #999999;
 /*  - Have this style cause default input size smaller;
  - so comment out for now.
 font-style: italic;
 */
}

Then, if you are using UiBinder, the Xml code is



 


蜀香苑FACEBOOK有了自己的URL了

今天看看facebook,蜀香苑page已经有23人like了,想看看能不能加短的URL,没想到真行了,今后这个<蜀香苑> Facebook URL: http://www.facebook.com/sichuanlegend 就更好记住了. 难道Facebook 取消了名额限制了?

Thursday, February 9, 2012

Dell Voice for Canada

While Google voice for calling phone is available only in US on Android, you can use Dell Voice to call Canadian phone for FREE. Dell's offer now is good for now, I believe Google or others are going to follow this soon.

Tuesday, August 30, 2011

Google+ has games

Just tried a moment ago. It has many popular games including Angry Birds, which was available only in Chrome for browsers. Now I can play it in Firefox.
Great!

Monday, August 29, 2011

Google Image Search

Just tried google's image search for curiosity. I use the profile picture from Szechuan Legend Restaurant's Facebook page.
The result comes with many colorful bamboo design. and the suggested keyword is "bamboo background". Not bad in my opinion.

蜀香苑在Facebook上的的广告

上周末在Facebook上打了个广告,两天就花掉了2大圆,而我还没看见广告到底出现在哪里。头一次做广告,还有点摸不倒头脑。不过蜀香苑Page倒是有了不少人气了,Like的人加到了12人。而且把Profile的图片更换了一下。希望人数能再快点,到25人就能做更多事了。

New Phone System

We had the new phone system today in our office. Looks fancy however ...
The phone is feature rich, but it's IP phone. Anyway, I guess the company is just trying to lower the cost. 5330 for me is too complicated. I may not use many of them in the life time.

Friday, July 15, 2011

Google+ and concern

Join the Google+ today, but I removed my profile photo too.
Maybe I am conservative, but the content is out of your hand once published. Even you close your account and delete all content, it's not guaranteed that things are clear. Yours are still somewhere on the net.
I am not a sociable person and don't want to. So keeping low profile is what I would like to do.

Wednesday, March 2, 2011

蜀香苑网站上加入了Facebook 和 Twitter

今天更新了网站,在抬头上加上了“Facebook” Page 的链接和 “Twitter” Follow。而且在每页上也植入了“Like”和“Tweet”功能。原来从来没研究过,原来Facebook还有这么多机关,而且推广网站和推广在Facebook上的Page还有很大不同。Tweet也是,还没搞的太清楚。
朋友对我网站界面的赞赏,很是让我激动啊!希望以后的“真功夫”也能接纳。呵呵...