diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-01-08 11:11:20 -0800 |
commit | b56ea2a18f232d79481e778085fd64e8ae486fc3 (patch) | |
tree | 44e1f6eb4864a45033f865b74fe783e3d784dd6a /samples/toolWindow | |
download | idea-b56ea2a18f232d79481e778085fd64e8ae486fc3.tar.gz |
Snapshot of commit d5ec1d5018ed24f1b4f32b1d09df6dbd7e2fc425
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'samples/toolWindow')
-rw-r--r-- | samples/toolWindow/.idea/ant.xml | 7 | ||||
-rw-r--r-- | samples/toolWindow/.idea/compiler.xml | 24 | ||||
-rw-r--r-- | samples/toolWindow/.idea/copyright/profiles_settings.xml | 5 | ||||
-rw-r--r-- | samples/toolWindow/.idea/encodings.xml | 5 | ||||
-rw-r--r-- | samples/toolWindow/.idea/misc.xml | 47 | ||||
-rw-r--r-- | samples/toolWindow/.idea/modules.xml | 9 | ||||
-rw-r--r-- | samples/toolWindow/.idea/uiDesigner.xml | 125 | ||||
-rw-r--r-- | samples/toolWindow/.idea/vcs.xml | 7 | ||||
-rw-r--r-- | samples/toolWindow/src/META-INF/plugin.xml | 28 | ||||
-rw-r--r-- | samples/toolWindow/src/myToolWindow/Calendar-icon.png | bin | 0 -> 2126 bytes | |||
-rw-r--r-- | samples/toolWindow/src/myToolWindow/MyToolWindow.form | 63 | ||||
-rw-r--r-- | samples/toolWindow/src/myToolWindow/MyToolWindowFactory.java | 79 | ||||
-rw-r--r-- | samples/toolWindow/src/myToolWindow/Time-icon.png | bin | 0 -> 3320 bytes | |||
-rw-r--r-- | samples/toolWindow/src/myToolWindow/Time-zone-icon.png | bin | 0 -> 3925 bytes | |||
-rw-r--r-- | samples/toolWindow/toolWindow.iml | 13 |
15 files changed, 412 insertions, 0 deletions
diff --git a/samples/toolWindow/.idea/ant.xml b/samples/toolWindow/.idea/ant.xml new file mode 100644 index 000000000000..2581ca3fe84c --- /dev/null +++ b/samples/toolWindow/.idea/ant.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="AntConfiguration"> + <defaultAnt bundledAnt="true" /> + </component> +</project> + diff --git a/samples/toolWindow/.idea/compiler.xml b/samples/toolWindow/.idea/compiler.xml new file mode 100644 index 000000000000..97c9ca5c8b0a --- /dev/null +++ b/samples/toolWindow/.idea/compiler.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="CompilerConfiguration"> + <option name="DEFAULT_COMPILER" value="Javac" /> + <resourceExtensions> + <entry name=".+\.(properties|xml|html|dtd|tld)" /> + <entry name=".+\.(gif|png|jpeg|jpg)" /> + </resourceExtensions> + <wildcardResourcePatterns> + <entry name="?*.properties" /> + <entry name="?*.xml" /> + <entry name="?*.gif" /> + <entry name="?*.png" /> + <entry name="?*.jpeg" /> + <entry name="?*.jpg" /> + <entry name="?*.html" /> + <entry name="?*.dtd" /> + <entry name="?*.tld" /> + <entry name="?*.ftl" /> + </wildcardResourcePatterns> + <annotationProcessing enabled="false" useClasspath="true" /> + </component> +</project> + diff --git a/samples/toolWindow/.idea/copyright/profiles_settings.xml b/samples/toolWindow/.idea/copyright/profiles_settings.xml new file mode 100644 index 000000000000..3572571ad83c --- /dev/null +++ b/samples/toolWindow/.idea/copyright/profiles_settings.xml @@ -0,0 +1,5 @@ +<component name="CopyrightManager"> + <settings default=""> + <module2copyright /> + </settings> +</component>
\ No newline at end of file diff --git a/samples/toolWindow/.idea/encodings.xml b/samples/toolWindow/.idea/encodings.xml new file mode 100644 index 000000000000..e206d70d8595 --- /dev/null +++ b/samples/toolWindow/.idea/encodings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> +</project> + diff --git a/samples/toolWindow/.idea/misc.xml b/samples/toolWindow/.idea/misc.xml new file mode 100644 index 000000000000..f10bc702e278 --- /dev/null +++ b/samples/toolWindow/.idea/misc.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DependencyValidationManager"> + <option name="SKIP_IMPORT_STATEMENTS" value="false" /> + </component> + <component name="Git.Settings"> + <option name="GIT_EXECUTABLE" value="C:\Program Files (x86)\Git\bin\git.exe" /> + <option name="CHECKOUT_INCLUDE_TAGS" value="false" /> + <option name="UPDATE_CHANGES_POLICY" value="STASH" /> + </component> + <component name="JavadocGenerationManager"> + <option name="OUTPUT_DIRECTORY" /> + <option name="OPTION_SCOPE" value="protected" /> + <option name="OPTION_HIERARCHY" value="true" /> + <option name="OPTION_NAVIGATOR" value="true" /> + <option name="OPTION_INDEX" value="true" /> + <option name="OPTION_SEPARATE_INDEX" value="true" /> + <option name="OPTION_DOCUMENT_TAG_USE" value="false" /> + <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" /> + <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" /> + <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" /> + <option name="OPTION_DEPRECATED_LIST" value="true" /> + <option name="OTHER_OPTIONS" value="" /> + <option name="HEAP_SIZE" /> + <option name="LOCALE" /> + <option name="OPEN_IN_BROWSER" value="true" /> + </component> + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA IC-96.1068" project-jdk-type="IDEA JDK"> + <output url="file://$PROJECT_DIR$/out" /> + </component> + <component name="SvnConfiguration" maxAnnotateRevisions="500"> + <option name="USER" value="" /> + <option name="PASSWORD" value="" /> + <option name="LAST_MERGED_REVISION" /> + <option name="UPDATE_RUN_STATUS" value="false" /> + <option name="MERGE_DRY_RUN" value="false" /> + <option name="MERGE_DIFF_USE_ANCESTRY" value="true" /> + <option name="UPDATE_LOCK_ON_DEMAND" value="false" /> + <option name="IGNORE_SPACES_IN_MERGE" value="false" /> + <option name="DETECT_NESTED_COPIES" value="true" /> + <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" /> + <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" /> + <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" /> + <myIsUseDefaultProxy>false</myIsUseDefaultProxy> + </component> +</project> + diff --git a/samples/toolWindow/.idea/modules.xml b/samples/toolWindow/.idea/modules.xml new file mode 100644 index 000000000000..77f0f0f79aaa --- /dev/null +++ b/samples/toolWindow/.idea/modules.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/toolWindow.iml" filepath="$PROJECT_DIR$/toolWindow.iml" /> + </modules> + </component> +</project> + diff --git a/samples/toolWindow/.idea/uiDesigner.xml b/samples/toolWindow/.idea/uiDesigner.xml new file mode 100644 index 000000000000..3b0002030884 --- /dev/null +++ b/samples/toolWindow/.idea/uiDesigner.xml @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Palette2"> + <group name="Swing"> + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> + </item> + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> + <initial-values> + <property name="text" value="Button" /> + </initial-values> + </item> + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="RadioButton" /> + </initial-values> + </item> + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="CheckBox" /> + </initial-values> + </item> + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="Label" /> + </initial-values> + </item> + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> + <preferred-size width="-1" height="20" /> + </default-constraints> + </item> + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> + </item> + </group> + </component> +</project> + diff --git a/samples/toolWindow/.idea/vcs.xml b/samples/toolWindow/.idea/vcs.xml new file mode 100644 index 000000000000..def6a6a18457 --- /dev/null +++ b/samples/toolWindow/.idea/vcs.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="" vcs="" /> + </component> +</project> + diff --git a/samples/toolWindow/src/META-INF/plugin.xml b/samples/toolWindow/src/META-INF/plugin.xml new file mode 100644 index 000000000000..0f5f27fc04c8 --- /dev/null +++ b/samples/toolWindow/src/META-INF/plugin.xml @@ -0,0 +1,28 @@ +<idea-plugin version="2"> + <name>Tool Window</name> + <description>This sample plugin illustrates how to create your custom tool window.</description> + <version>1.0</version> + <vendor>JetBrains</vendor> + <!-- + <idea-version since-build="8000"/> + --> + <application-components> + <!-- Add your application components here --> + </application-components> + + <project-components> + <!-- Add your project components here --> + + </project-components> + + <actions> + <!-- Add your actions here --> + </actions> + + <extensions defaultExtensionNs="com.intellij"> + <!-- Add your extensions here --> + <toolWindow id="Sample Calendar" secondary="true" icon="/general/add.png" anchor="right" factoryClass="myToolWindow.MyToolWindowFactory" > + + </toolWindow> + </extensions> +</idea-plugin>
\ No newline at end of file diff --git a/samples/toolWindow/src/myToolWindow/Calendar-icon.png b/samples/toolWindow/src/myToolWindow/Calendar-icon.png Binary files differnew file mode 100644 index 000000000000..4d8110fd62c0 --- /dev/null +++ b/samples/toolWindow/src/myToolWindow/Calendar-icon.png diff --git a/samples/toolWindow/src/myToolWindow/MyToolWindow.form b/samples/toolWindow/src/myToolWindow/MyToolWindow.form new file mode 100644 index 000000000000..515e60337889 --- /dev/null +++ b/samples/toolWindow/src/myToolWindow/MyToolWindow.form @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="myToolWindow.MyToolWindowFactory"> + <grid id="27dc6" binding="myToolWindowContent" layout-manager="GridLayoutManager" row-count="2" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1"> + <margin top="0" left="0" bottom="0" right="0"/> + <constraints> + <xy x="20" y="20" width="500" height="400"/> + </constraints> + <properties/> + <border type="none"/> + <children> + <component id="9aa3f" class="javax.swing.JLabel" binding="currentDate"> + <constraints> + <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Date"/> + </properties> + </component> + <component id="44be3" class="javax.swing.JLabel" binding="timeZone"> + <constraints> + <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="TimeZone"/> + </properties> + </component> + <component id="f02af" class="javax.swing.JLabel" binding="currentTime"> + <constraints> + <grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Time"/> + </properties> + </component> + <component id="5fceb" class="javax.swing.JButton" binding="refreshToolWindowButton"> + <constraints> + <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Refresh"/> + </properties> + </component> + <component id="3edc1" class="javax.swing.JButton" binding="hideToolWindowButton"> + <constraints> + <grid row="1" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + <properties> + <text value="Hide"/> + </properties> + </component> + <hspacer id="8bf9c"> + <constraints> + <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + </hspacer> + <hspacer id="26841"> + <constraints> + <grid row="1" column="4" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/> + </constraints> + </hspacer> + </children> + </grid> +</form> diff --git a/samples/toolWindow/src/myToolWindow/MyToolWindowFactory.java b/samples/toolWindow/src/myToolWindow/MyToolWindowFactory.java new file mode 100644 index 000000000000..2800ad4d9417 --- /dev/null +++ b/samples/toolWindow/src/myToolWindow/MyToolWindowFactory.java @@ -0,0 +1,79 @@ +package myToolWindow; + +import com.intellij.openapi.project.Project; +import com.intellij.openapi.wm.ToolWindow; +import com.intellij.openapi.wm.ToolWindowFactory; +import com.intellij.ui.content.Content; +import com.intellij.ui.content.ContentFactory; + +import javax.swing.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Calendar; + +/** + * Created by IntelliJ IDEA. + * User: Alexey.Chursin + * Date: Aug 25, 2010 + * Time: 2:09:00 PM + */ +public class MyToolWindowFactory implements ToolWindowFactory { + + private JButton refreshToolWindowButton; + private JButton hideToolWindowButton; + private JLabel currentDate; + private JLabel currentTime; + private JLabel timeZone; + private JPanel myToolWindowContent; + private ToolWindow myToolWindow; + + + public MyToolWindowFactory() { + hideToolWindowButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + myToolWindow.hide(null); + } + }); + refreshToolWindowButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + MyToolWindowFactory.this.currentDateTime(); + } + }); + } + + // Create the tool window content. + public void createToolWindowContent(Project project, ToolWindow toolWindow) { + myToolWindow = toolWindow; + this.currentDateTime(); + ContentFactory contentFactory = ContentFactory.SERVICE.getInstance(); + Content content = contentFactory.createContent(myToolWindowContent, "", false); + toolWindow.getContentManager().addContent(content); + + } + + public void currentDateTime() { + // Get current date and time + Calendar instance = Calendar.getInstance(); + currentDate.setText(String.valueOf(instance.get(Calendar.DAY_OF_MONTH)) + "/" + + String.valueOf(instance.get(Calendar.MONTH) + 1) + "/" + String.valueOf(instance.get(Calendar.YEAR))); + currentDate.setIcon(new ImageIcon(getClass().getResource("/myToolWindow/Calendar-icon.png"))); + int min = instance.get(Calendar.MINUTE); + String strMin; + if (min < 10) { + strMin = "0" + String.valueOf(min); + } else { + strMin = String.valueOf(min); + } + currentTime.setText(instance.get(Calendar.HOUR_OF_DAY) + ":" + strMin); + currentTime.setIcon(new ImageIcon(getClass().getResource("/myToolWindow/Time-icon.png"))); + // Get time zone + long gmt_Offset = instance.get(Calendar.ZONE_OFFSET); // offset from GMT in milliseconds + String str_gmt_Offset = String.valueOf(gmt_Offset / 3600000); + str_gmt_Offset = (gmt_Offset > 0) ? "GMT + " + str_gmt_Offset : "GMT - " + str_gmt_Offset; + timeZone.setText(str_gmt_Offset); + timeZone.setIcon(new ImageIcon(getClass().getResource("/myToolWindow/Time-zone-icon.png"))); + + + } + +} diff --git a/samples/toolWindow/src/myToolWindow/Time-icon.png b/samples/toolWindow/src/myToolWindow/Time-icon.png Binary files differnew file mode 100644 index 000000000000..c5d82eff44b7 --- /dev/null +++ b/samples/toolWindow/src/myToolWindow/Time-icon.png diff --git a/samples/toolWindow/src/myToolWindow/Time-zone-icon.png b/samples/toolWindow/src/myToolWindow/Time-zone-icon.png Binary files differnew file mode 100644 index 000000000000..7d5797395e0a --- /dev/null +++ b/samples/toolWindow/src/myToolWindow/Time-zone-icon.png diff --git a/samples/toolWindow/toolWindow.iml b/samples/toolWindow/toolWindow.iml new file mode 100644 index 000000000000..09647c68eae8 --- /dev/null +++ b/samples/toolWindow/toolWindow.iml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="PLUGIN_MODULE" version="4"> + <component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/src/META-INF/plugin.xml" /> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="jdk" jdkName="IDEA IC-96.1068" jdkType="IDEA JDK" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> + |