* Preferences and Fetchers buttons added to the MainWindow

* png icons are taken from the gnome Echo theme (by Fedora)

git-svn-id: https://ipscan.svn.sourceforge.net/svnroot/ipscan/trunk@236 375186e5-ef17-0410-b0b6-91563547dcda
This commit is contained in:
angryziber 2007-11-10 15:28:48 +00:00
parent 403dc52aea
commit 2ed38652a9
10 changed files with 565 additions and 11 deletions

6
TODO
View File

@ -1,7 +1,3 @@
Before 3.0 beta:
* export/import of settings (profiles?)
Before 3.0:
* command-line scanning start
@ -10,8 +6,8 @@ Before 3.0:
* add new fetchers by configuration of PortTextFetcher
* startup as root option
* compile librocksaw for mac
* preferences & select fetchers buttons in the toolbar
* plugin loader
* export/import of settings (profiles?)
Later:

View File

@ -30,3 +30,4 @@ compiz
placeholder
firewall
registry
combo

View File

@ -79,7 +79,7 @@ text.threads=Threads:
text.display.ALL=Display: All
text.display.ALIVE=Display: Alive only
text.display.PORTS=Display: Open ports
text.hostsSelected= hosts selected
text.hostsSelected=\u00A0hosts selected
text.favorite.add=Enter the name of the new favorite
text.favorite.edit=Below you can rearrange or delete favorites
text.find=Enter the text to search for
@ -133,6 +133,8 @@ button.kill=Stop!
button.kill.img=images/buttons/kill.png
button.ipUp=IP
button.ipUp.img=images/buttons/ipup.png
button.preferences.img=images/buttons/prefs.png
button.fetchers.img=images/buttons/fetchers.png
button.up=&Up
button.down=&Down
button.delete=De&lete

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

View File

@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16px"
height="16px"
id="svg1872"
sodipodi:version="0.32"
inkscape:version="0.45.1"
sodipodi:docbase="/home/anton/workspaces/ipscan/ipscan/resources/images/buttons"
sodipodi:docname="fetchers.svg"
inkscape:export-filename="/home/anton/workspaces/ipscan/ipscan/resources/images/buttons/fetchers.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs1874">
<linearGradient
id="linearGradient14393">
<stop
style="stop-color:#223c6b;stop-opacity:1;"
offset="0"
id="stop14395" />
<stop
id="stop3172"
offset="0.31617856"
style="stop-color:#345693;stop-opacity:1;" />
<stop
id="stop14411"
offset="0.74618143"
style="stop-color:#5184e0;stop-opacity:1;" />
<stop
style="stop-color:#d9e0ec;stop-opacity:1;"
offset="0.88049412"
id="stop3170" />
<stop
style="stop-color:#1153c7;stop-opacity:1;"
offset="1"
id="stop14397" />
</linearGradient>
<linearGradient
id="linearGradient2947">
<stop
style="stop-color:#595b3d;stop-opacity:1;"
offset="0"
id="stop2949" />
<stop
id="stop13420"
offset="0.5"
style="stop-color:#e4cf2a;stop-opacity:1;" />
<stop
style="stop-color:#ffdd4c;stop-opacity:1;"
offset="1"
id="stop2951" />
</linearGradient>
<linearGradient
id="linearGradient2835">
<stop
id="stop2837"
offset="0"
style="stop-color:#6b5f5d;stop-opacity:1;" />
<stop
style="stop-color:#988683;stop-opacity:0.91764706;"
offset="0.92105263"
id="stop2841" />
<stop
id="stop2839"
offset="1"
style="stop-color:#c6aeaa;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2825">
<stop
style="stop-color:white;stop-opacity:1;"
offset="0"
id="stop2827" />
<stop
id="stop2843"
offset="0.5"
style="stop-color:white;stop-opacity:0.49803922;" />
<stop
style="stop-color:#c81e00;stop-opacity:0;"
offset="1"
id="stop2829" />
</linearGradient>
<linearGradient
id="linearGradient2778">
<stop
style="stop-color:#640000;stop-opacity:1;"
offset="0"
id="stop2780" />
<stop
style="stop-color:#34ff22;stop-opacity:1;"
offset="1"
id="stop2782" />
</linearGradient>
<linearGradient
id="linearGradient2770">
<stop
style="stop-color:#60140a;stop-opacity:1;"
offset="0"
id="stop2772" />
<stop
style="stop-color:#c30000;stop-opacity:1;"
offset="1"
id="stop2774" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2770"
id="linearGradient2776"
x1="4.2124505"
y1="1.2688119"
x2="8.9420052"
y2="12.576238"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2786"
x1="0.84492546"
y1="-2.4762006"
x2="10.446789"
y2="7.5757427"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2801"
gradientUnits="userSpaceOnUse"
x1="7.5670261"
y1="9.4191189"
x2="11.453006"
y2="13.71922"
gradientTransform="matrix(0.922118,0,0,0.922118,0.175474,0.130764)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2825"
id="radialGradient2831"
cx="4.9103961"
cy="3.521287"
fx="4.9103961"
fy="3.521287"
r="1.7569307"
gradientTransform="matrix(1,0,0,0.230769,0,2.708682)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2835"
id="radialGradient2833"
cx="7.635891"
cy="7.5757427"
fx="7.635891"
fy="7.5757427"
r="7.6809406"
gradientTransform="matrix(1,0,0,0.979472,0,0.155514)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2770"
id="linearGradient2915"
x1="10.727985"
y1="11.462597"
x2="6.3377886"
y2="4.017067"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.222938,0,0,1.402663,-0.867998,-2.498369)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2943"
x1="6.4287758"
y1="4.7826738"
x2="8.3915367"
y2="9.0173273"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.059021,0,0,1.059021,2.475796e-3,8.947768e-2)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient14393"
id="linearGradient14399"
x1="1.1827326"
y1="5.3908415"
x2="16.792019"
y2="5.3908415"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient14393"
id="linearGradient14409"
x1="13.330198"
y1="6.661881"
x2="3.9311879"
y2="10.220792"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-9.104471e-5,-1.6529977)" />
<filter
inkscape:collect="always"
x="-0.063920155"
width="1.1278403"
y="-0.16406223"
height="1.3281245"
id="filter5162">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.33059893"
id="feGaussianBlur5164" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="22.197802"
inkscape:cx="4.3960396"
inkscape:cy="9.091993"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1024"
inkscape:window-height="726"
inkscape:window-x="0"
inkscape:window-y="42" />
<metadata
id="metadata1877">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:type="arc"
style="opacity:1;fill:#a2a2a2;fill-opacity:1;stroke:none;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter5162)"
id="path4143"
sodipodi:cx="10.04604"
sodipodi:cy="12.981683"
sodipodi:rx="6.2168317"
sodipodi:ry="2.3876238"
d="M 16.262871 12.981683 A 6.2168317 2.3876238 0 1 1 3.8292079,12.981683 A 6.2168317 2.3876238 0 1 1 16.262871 12.981683 z"
transform="matrix(0.8266772,-0.304454,0.5281996,0.4579951,-4.4545723,11.299039)"
inkscape:transform-center-y="-0.34081747" />
<path
style="fill:url(#linearGradient14409);fill-opacity:1;fill-rule:evenodd;stroke:#041a4c;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 0.54050302,2.5272003 C 4.5499091,10.590071 4.5583248,10.553932 4.5583248,10.553932 L 6.4245646,12.056114 L 6.4244366,15.630565 L 9.5504042,15.689577 L 9.6054776,12.234884 L 11.66674,10.77918 L 15.459315,2.3920518"
id="path14401"
sodipodi:nodetypes="cccccccc" />
<path
sodipodi:type="arc"
style="opacity:1;fill:url(#linearGradient14399);fill-opacity:1;stroke:#041a4c;stroke-width:0.78818715;stroke-linecap:square;stroke-linejoin:bevel;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path13422"
sodipodi:cx="9.1675739"
sodipodi:cy="5.3908415"
sodipodi:rx="7.9962869"
sodipodi:ry="1.7794554"
d="M 17.163861 5.3908415 A 7.9962869 1.7794554 0 1 1 1.1712871,5.3908415 A 7.9962869 1.7794554 0 1 1 17.163861 5.3908415 z"
transform="matrix(0.9522659,0,0,1.0048282,-0.7300593,-3.2433226)" />
<path
style="fill:none;fill-rule:evenodd;stroke:#041a4c;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="M 14,6 L 16,7 L 14,11.45 L 12,10.458911"
id="path14413" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1016 B

View File

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://web.resource.org/cc/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16px"
height="16px"
id="svg1872"
sodipodi:version="0.32"
inkscape:version="0.45.1"
sodipodi:docbase="/home/anton/workspaces/ipscan/ipscan/resources/images/buttons"
sodipodi:docname="prefs.svg"
inkscape:export-filename="/home/anton/workspaces/ipscan/ipscan/resources/images/buttons/prefs.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90"
inkscape:output_extension="org.inkscape.output.svg.inkscape">
<defs
id="defs1874">
<linearGradient
id="linearGradient2947">
<stop
style="stop-color:#494c4e;stop-opacity:1;"
offset="0"
id="stop2949" />
<stop
id="stop13420"
offset="0.27118644"
style="stop-color:#65a9a2;stop-opacity:1;" />
<stop
style="stop-color:#f4f6f5;stop-opacity:1;"
offset="1"
id="stop2951" />
</linearGradient>
<linearGradient
id="linearGradient2835">
<stop
id="stop2837"
offset="0"
style="stop-color:#6b5f5d;stop-opacity:1;" />
<stop
style="stop-color:#988683;stop-opacity:0.91764706;"
offset="0.92105263"
id="stop2841" />
<stop
id="stop2839"
offset="1"
style="stop-color:#c6aeaa;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2825">
<stop
style="stop-color:white;stop-opacity:1;"
offset="0"
id="stop2827" />
<stop
id="stop2843"
offset="0.5"
style="stop-color:white;stop-opacity:0.49803922;" />
<stop
style="stop-color:#c81e00;stop-opacity:0;"
offset="1"
id="stop2829" />
</linearGradient>
<linearGradient
id="linearGradient2778">
<stop
style="stop-color:#640000;stop-opacity:1;"
offset="0"
id="stop2780" />
<stop
style="stop-color:#34ff22;stop-opacity:1;"
offset="1"
id="stop2782" />
</linearGradient>
<linearGradient
id="linearGradient2770">
<stop
style="stop-color:#60140a;stop-opacity:1;"
offset="0"
id="stop2772" />
<stop
style="stop-color:#c30000;stop-opacity:1;"
offset="1"
id="stop2774" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2770"
id="linearGradient2776"
x1="4.2124505"
y1="1.2688119"
x2="8.9420052"
y2="12.576238"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2786"
x1="0.84492546"
y1="-2.4762006"
x2="10.446789"
y2="7.5757427"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2801"
gradientUnits="userSpaceOnUse"
x1="7.5670261"
y1="9.4191189"
x2="11.453006"
y2="13.71922"
gradientTransform="matrix(0.922118,0,0,0.922118,0.175474,0.130764)" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2825"
id="radialGradient2831"
cx="4.9103961"
cy="3.521287"
fx="4.9103961"
fy="3.521287"
r="1.7569307"
gradientTransform="matrix(1,0,0,0.230769,0,2.708682)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient2835"
id="radialGradient2833"
cx="7.635891"
cy="7.5757427"
fx="7.635891"
fy="7.5757427"
r="7.6809406"
gradientTransform="matrix(1,0,0,0.979472,0,0.155514)"
gradientUnits="userSpaceOnUse" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2770"
id="linearGradient2915"
x1="10.727985"
y1="11.462597"
x2="6.3377886"
y2="4.017067"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.222938,0,0,1.402663,-0.867998,-2.498369)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2778"
id="linearGradient2943"
x1="6.4287758"
y1="4.7826738"
x2="8.3915367"
y2="9.0173273"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(1.059021,0,0,1.059021,2.475796e-3,8.947768e-2)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient2947"
id="linearGradient5434"
x1="0.046534982"
y1="7.4727721"
x2="15"
y2="7.4727721"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-4.653498e-2,5.445617e-2)" />
<filter
inkscape:collect="always"
id="filter8471">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.23335295"
id="feGaussianBlur8473" />
</filter>
<filter
inkscape:collect="always"
id="filter7150">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="0.370406"
id="feGaussianBlur7152" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="15.696216"
inkscape:cx="8"
inkscape:cy="9.091993"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="1024"
inkscape:window-height="726"
inkscape:window-x="0"
inkscape:window-y="42" />
<metadata
id="metadata1877">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<path
sodipodi:nodetypes="ccccccccccccccccccccc"
id="path6405"
d="M 8.9032542,4.7203955 C 3.7433522,10.226 4.45416,8.964614 4.45416,8.964614 L 1.9488904,9.234911 L 1.125327,11.438633 L 1.2830675,13.232521 L 3.3509637,11.257247 L 4.9069391,13.302634 L 3.0542773,15.506356 L 5.9407936,15.551406 L 8.2606478,13.123763 L 8.645786,10.932157 L 10.765887,8.3933073 L 13.388511,8.1047765 L 15.605862,5.3267125 L 15.402669,2.8320192 L 13.45995,4.8104945 L 11.532512,3.0274411 L 13.288953,1.1528878 L 10.549235,1.3941378 L 8.6538082,2.7869697 L 8.9032542,4.7203955 z "
style="fill:#959595;fill-opacity:1;fill-rule:evenodd;stroke:#b7b7b7;stroke-width:0.78827566px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;filter:url(#filter7150)" />
<path
style="fill:url(#linearGradient5434);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.78827566px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;opacity:1"
d="M 2.3889883,7.5235256 L 0.57433585,9.5470499 L 0.42766064,12.312041 L 2.5483355,10.513763 L 4.4910963,12.627388 L 2.6384345,14.650912 L 5.4348518,14.515763 L 7.4780059,12.672437 L 7.5104772,10.583189 L 10.517986,7.4490896 L 12.638663,7.4044666 L 14.559328,5.3722578 L 14.671481,2.5171685 L 12.458464,4.4956438 L 10.650716,2.6070328 L 12.449005,0.50723196 L 9.5477495,0.49364351 L 7.5171734,2.1567724 L 7.4855712,4.5172155 L 4.4465003,7.5149629 L 2.3889883,7.5235256 z "
id="path3478"
sodipodi:nodetypes="ccccccccccccccccccccc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#e7fbfb;stroke-width:1px;stroke-linecap:square;stroke-linejoin:bevel;stroke-opacity:1;marker-end:none;filter:url(#filter8471);opacity:0.84324324"
d="M 1.090099,10.819306 L 1.3153465,9.8282174 L 2.7029704,8.1891089 L 4.720792,8.0712871 L 8.19901,4.450495 L 8.1539605,2.4054455 L 9.7747525,1.0450495 L 10.991089,1.090099"
id="path7384"
sodipodi:nodetypes="cccccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -149,6 +149,8 @@ public class ComponentRegistry {
anyComponentParameter,
anyComponentParameter,
anyComponentParameter,
anyComponentParameter,
anyComponentParameter,
anyComponentParameter});
container.registerComponentImplementation(ResultTable.class, ResultTable.class, new Parameter[] {
new ComponentParameter("mainShell"),
@ -186,6 +188,8 @@ public class ComponentRegistry {
container.registerComponentImplementation(ColumnsActions.AboutFetcher.class);
container.registerComponentImplementation(ColumnsActions.ColumnClick.class);
container.registerComponentImplementation(ColumnsActions.ColumnResize.class);
container.registerComponentImplementation(ToolsActions.Preferences.class);
container.registerComponentImplementation(ToolsActions.ChooseFetchers.class);
container.registerComponentImplementation(ToolsActions.TableSelection.class);
}

View File

@ -15,6 +15,7 @@ import net.azib.ipscan.core.state.StateMachine;
import net.azib.ipscan.core.state.StateTransitionListener;
import net.azib.ipscan.gui.MainMenu.CommandsMenu;
import net.azib.ipscan.gui.actions.StartStopScanningAction;
import net.azib.ipscan.gui.actions.ToolsActions;
import net.azib.ipscan.gui.feeders.AbstractFeederGUI;
import net.azib.ipscan.gui.feeders.FeederGUIRegistry;
import net.azib.ipscan.gui.util.LayoutHelper;
@ -32,6 +33,7 @@ import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MessageBox;
@ -54,18 +56,20 @@ public class MainWindow {
private Combo feederSelectionCombo;
private FeederGUIRegistry feederRegistry;
private Button prefsButton;
private Button fetchersButton;
/**
* Creates and initializes the main window.
*/
public MainWindow(Shell shell, GlobalConfig globalConfig, Composite feederArea, Composite controlsArea, Combo feederSelectionCombo, Button startStopButton, StartStopScanningAction startStopScanningAction, ResultTable resultTable, StatusBar statusBar, CommandsMenu resultsContextMenu, FeederGUIRegistry feederGUIRegistry, StateMachine stateMachine) {
public MainWindow(Shell shell, GlobalConfig globalConfig, Composite feederArea, Composite controlsArea, Combo feederSelectionCombo, Button startStopButton, StartStopScanningAction startStopScanningAction, ResultTable resultTable, StatusBar statusBar, CommandsMenu resultsContextMenu, FeederGUIRegistry feederGUIRegistry, StateMachine stateMachine, ToolsActions.Preferences preferencesListener, ToolsActions.ChooseFetchers chooseFetchersListsner) {
this.globalConfig = globalConfig;
initShell(shell);
initFeederArea(feederArea, feederGUIRegistry);
initControlsArea(controlsArea, feederSelectionCombo, startStopButton, startStopScanningAction);
initControlsArea(controlsArea, feederSelectionCombo, startStopButton, startStopScanningAction, preferencesListener, chooseFetchersListsner);
initTableAndStatusBar(resultTable, resultsContextMenu, statusBar);
@ -83,7 +87,7 @@ public class MainWindow {
if (globalConfig.isFirstRun) {
if (Platform.CRIPPLED_WINDOWS) {
// inform crippled windows owners of configuration changes
// inform crippled windows owners of their default configuration
MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK);
box.setText(Version.NAME);
box.setMessage(Labels.getLabel("text.crippledWindowsInfo"));
@ -150,7 +154,7 @@ public class MainWindow {
/**
* This method initializes main controls of the main window
*/
private void initControlsArea(Composite controlsArea, Combo feederSelectionCombo, Button startStopButton, StartStopScanningAction startStopScanningAction) {
private void initControlsArea(final Composite controlsArea, final Combo feederSelectionCombo, final Button startStopButton, final StartStopScanningAction startStopScanningAction, final ToolsActions.Preferences preferencesListener, final ToolsActions.ChooseFetchers chooseFetchersListsner) {
controlsArea.setLayoutData(LayoutHelper.formData(new FormAttachment(feederArea), new FormAttachment(100), new FormAttachment(0), new FormAttachment(feederArea, 0, SWT.BOTTOM)));
RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
@ -182,6 +186,31 @@ public class MainWindow {
((RowData)startStopButton.getLayoutData()).height = feederSelectionCombo.getBounds().height;
((RowData)startStopButton.getLayoutData()).width = feederSelectionCombo.getBounds().width;
// traverse the button before the combo (and don't traverse other buttons at all)
controlsArea.setTabList(new Control[] {startStopButton, feederSelectionCombo});
prefsButton = new Button(controlsArea, SWT.NONE);
prefsButton.setImage(new Image(null, Labels.getInstance().getImageAsStream("button.preferences.img")));
prefsButton.setToolTipText(Labels.getLabel("title.preferences"));
prefsButton.setLayoutData(new RowData(controlHeight, controlHeight));
prefsButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
startStopButton.forceFocus();
preferencesListener.handleEvent(event);
}
});
fetchersButton = new Button(controlsArea, SWT.NONE);
fetchersButton.setImage(new Image(null, Labels.getInstance().getImageAsStream("button.fetchers.img")));
fetchersButton.setToolTipText(Labels.getLabel("title.fetchers.select"));
fetchersButton.setLayoutData(new RowData(controlHeight, controlHeight));
fetchersButton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
startStopButton.forceFocus();
chooseFetchersListsner.handleEvent(event);
}
});
}
/**
@ -215,7 +244,10 @@ public class MainWindow {
shell.getDisplay().asyncExec(new Runnable() {
public void run() {
feederSelectionCombo.setEnabled(state == ScanningState.IDLE);
boolean enabled = state == ScanningState.IDLE;
feederSelectionCombo.setEnabled(enabled);
prefsButton.setEnabled(enabled);
fetchersButton.setEnabled(enabled);
}
});
}